Change the views return model to Employee like below.The Exception is because you are returning the collection of Type Employee but the views expect type Test1. If you want to return a collection to a view you must change the view return type to IEnumerable<type> like below
@model IEnumerable<yournamespace.employee>
@{
ViewBag.Title = "Index";
}
<html>
<body>
<div>
@foreach(var item in Model){
@Html.LabelFor(item.ID.ToString())
@Html.LabelFor(item.Code.ToString())
@Html.LabelFor(item.Name.ToString())
@Html.LabelFor(item.Department.ToString())
}
</div>
</body>
</html>
</yournamespace.employee>
If you want to return a particular record in to the view use like below
@model YourNameSpace.Employee
@{
ViewBag.Title = "Index";
}
<html>
<body>
<div>
@Html.LabelFor(Model=>Model.ID.ToString())
@Html.LabelFor(Model=>Model.Code.ToString())
@Html.LabelFor(Model=>Model.Name.ToString())
@Html.LabelFor(Model=>Model.Department.ToString())
</div>
</body>
</html>
and also you must return Employee type in to that ActionResult not List<employee> like below
public ActionResult Index()
{
Employee emp= te.Employees.FirstOrDefault(x=>x.id=1)
return View(emp);
}