using (SmartEntities employeeverificationcontext = new SmartEntities())
{
Employee emp = (from c in employeeverificationcontext.EmployeeEntity
where c.Employee_ID == emp_detail.EmployeeID
select new Employee {c.Status}).FirstOrDefault();
emp.Status = emp_detail.Status;
int i=employeeverificationcontext.SaveChanges();
if (i > 0)
{
result = "Verification Process Completed";
}
}
error: Error 1 Cannot initialize type ‘SmartWCF.Employee’ with a collection initializer because it does not implement ‘System.Collections.IEnumerable’**
Instead of
select new Employee {c.Status}you should select the current object (c)So your query should be:
or