Пример #1
0
 public void DeleteUser(int id)
 {
     using (UserServiceReference.ServiceClient client = new UserServiceReference.ServiceClient())
     {
         client.DeleteUser(id);
     }
 }
Пример #2
0
 public UserServiceReference.UserRequest GetUser(int id)
 {
     using (UserServiceReference.ServiceClient client = new UserServiceReference.ServiceClient())
     {
         return client.GetUserById(new UserServiceReference.GetUserById() { inputUserId = id});
     }
 }
Пример #3
0
 public void DeleteUser(int id)
 {
     using (UserServiceReference.ServiceClient client = new UserServiceReference.ServiceClient())
     {
         client.DeleteUser(id);
     }
 }
Пример #4
0
 public List <UserServiceReference.UserRequest> GetUsers()
 {
     using (UserServiceReference.ServiceClient client = new UserServiceReference.ServiceClient())
     {
         var users = client.GetAllUsers();
         return(users.ToList());
     }
 }
Пример #5
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;
     }
 }
Пример #6
0
 public List<UserServiceReference.UserRequest> GetUsers()
 {
     using (UserServiceReference.ServiceClient client = new UserServiceReference.ServiceClient())
     {
         var users = client.GetAllUsers();
         return users.ToList();
     }
 }
Пример #7
0
 public UserServiceReference.UserRequest GetUser(int id)
 {
     using (UserServiceReference.ServiceClient client = new UserServiceReference.ServiceClient())
     {
         return(client.GetUserById(new UserServiceReference.GetUserById()
         {
             inputUserId = id
         }));
     }
 }
Пример #8
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);
     }
 }