/// <summary> /// Operation testing the addition of a user /// </summary> /// <param name="userToAdd"></param> /// <returns></returns> public OperationResult Post(User userToAdd) { AddUser(userToAdd); return new OperationResult.Created { RedirectLocation = userToAdd.CreateUri(), ResponseResource = userToAdd }; }
void AddUser(User userToAdd) { _userRepository.Add(userToAdd); userToAdd.Id = _userRepository.Count; }