コード例 #1
0
 /// <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
     };
 }
コード例 #2
0
 void AddUser(User userToAdd)
 {
     _userRepository.Add(userToAdd);
     userToAdd.Id = _userRepository.Count;
 }