public GroupViewModel(Group group, ICollection<User> currentUsers, ICollection<User> allUsers) { Group = group; CurrentUsers = currentUsers; AllUsers = allUsers; if (Group == null) { Group = new Group(); } }
public Group Save(Group group) { using (var context = GetContext()) { if (group.Id == 0) { context.Entry<Group>(group).State = System.Data.EntityState.Added; } else { context.Entry<Group>(group).State = System.Data.EntityState.Modified; } context.SaveChanges(); return group; } }
public JsonResult Save(Group group) { return Json(null); }