public async Task <IActionResult> CreateUser(UserDto userDto) { try { var user = await _serviceManageUser.CreateUser(userDto); return(CreatedAtAction(nameof(GetUserById), new { id = user.Id }, user)); } catch (Exception ex) { var exception = ex; return(BadRequest("Erro ao criar o usuário")); } }
public void CreateUSerIfNotExist() { var users = _serviceManageUser.GetUsers().Result; if (!users.Any()) { var userDto = new UserDto() { Email = "*****@*****.**", Login = "******", Nome = "Admin", Senha = "Admin123" }; var user = _serviceManageUser.CreateUser(userDto).Result; } }