Example #1
0
 public UserServiceReference.UserRequest GetUser(int id)
 {
     using (UserServiceReference.ServiceClient client = new UserServiceReference.ServiceClient())
     {
         return client.GetUserById(new UserServiceReference.GetUserById() { inputUserId = id});
     }
 }
Example #2
0
 public void DeleteUser(int id)
 {
     using (UserServiceReference.ServiceClient client = new UserServiceReference.ServiceClient())
     {
         client.DeleteUser(id);
     }
 }
Example #3
0
 public int PostUser(UserServiceReference.UserRequest user)
 {
     using (UserServiceReference.ServiceClient client = new UserServiceReference.ServiceClient())
     {
         int createdId = (int) client.CreateUser(new UserServiceReference.CreateUser() { inputUserRequest = user });
         return createdId;
     }
 }
Example #4
0
 public List<UserServiceReference.UserRequest> GetUsers()
 {
     using (UserServiceReference.ServiceClient client = new UserServiceReference.ServiceClient())
     {
         var users = client.GetAllUsers();
         return users.ToList();
     }
 }