public async Task <ActionResult <User> > AddUserAsync([FromBody] User user) { try{ User user1 = await userService.AddUserAsync(user); return(Ok(user1)); }catch (Exception e) { Console.WriteLine(e.Message); StatusCode(409, e.Message); } return(null); }
public async Task <IActionResult> AddUserAsync([FromBody] User user) { await _user.AddUserAsync(user); return(Ok("EmployeeData gets created")); }