public int UpdateEmployees(IEnumerable <employee> items) { using (IOPContext db = new IOPContext()) { EmployeeConverter converter = new EmployeeConverter(db); foreach (var item in items) { var model = converter.FromDto(item); db.Entry(model).State = System.Data.Entity.EntityState.Modified; } return(db.SaveChanges()); } }