Пример #1
0
 public User CreateUser(UserWithLogin userWithLogin)
 {
     try
     {
         return(_userRepository.CreateUser(userWithLogin));
     }
     catch (Exception)
     {
         throw new Exception("Cannot create user.\n");
     }
 }
Пример #2
0
 public IActionResult CreateUser([FromBody] UserWithLogin userWithLogin)
 {
     try
     {
         return(Ok(_facade.CreateUser(userWithLogin)));
     }
     catch (Exception e)
     {
         Console.WriteLine(e.ToString());
         return(NotFound());
     }
 }