public IActionResult AddUser(User user) { if (ModelState.IsValid) { user = _userServices.CreateUser(user); return(Ok(user)); } Response.StatusCode = 200; return(BadRequest("User is not well introduced")); }
public User Create([FromBody] UserServiceModel user) { return(_usersServices.CreateUser(user)); }
public IActionResult CreateUser(User user) { var newUser = _usersServices.CreateUser(user); return(CreatedAtRoute("GetUser", new { newUser.Username }, newUser)); }