public User AddNewUser(User newUser) { if (newUser == null) throw new ArgumentNullException("newUser"); newUser.Id = counter++; Users.Add(newUser); return newUser; }
public string UpdateUser(User User, string id) { bool updated = repository.UpdateAUser(User); if (updated) return "User with id = " + id + " updated successfully"; else return "Unable to update User with id = " + id; }
public bool UpdateAUser(User updatedUser) { if (updatedUser == null) throw new ArgumentNullException("updatedUser"); int idx = Users.FindIndex(b => b.Id == updatedUser.Id); if (idx == -1) return false; Users.RemoveAt(idx); Users.Add(updatedUser); return true; }
public List <Group> GetUserGroups(User user) { return(_service.GetUserGroups(user)); }
public List <Record> GetUserRecords(User user) { return(_service.GetUserRecords(user)); }
public void UpdateUser(User user, string[] update_fields) { _service.UpdateUser(user, update_fields); }
public string AddUser(User User, string id) { User newUser = repository.AddNewUser(User); return "id=" + newUser.Id; }