Пример #1
0
        public IActionResult Post([FromForm] UserCreationModel newUser)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var success = _business.AddNewUser(newUser);

            if (success != null)
            {
                return(Created("users", success));
            }
            return(Conflict(new { message = "Account already exists" }));
        }