public User CreateUser(UserWithLogin userWithLogin) { try { return(_userRepository.CreateUser(userWithLogin)); } catch (Exception) { throw new Exception("Cannot create user.\n"); } }
public IActionResult CreateUser([FromBody] UserWithLogin userWithLogin) { try { return(Ok(_facade.CreateUser(userWithLogin))); } catch (Exception e) { Console.WriteLine(e.ToString()); return(NotFound()); } }