Ejemplo n.º 1
0
        public IActionResult AddUser([FromBody] UserForCreationDTO userFromRequest)
        {
            if (userFromRequest == null)
            {
                return(BadRequest());
            }
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            userFromRequest.Password = GetPasswordHash(userFromRequest.Password);

            _repo.AddUser(ModelsMapping.GetUserEntity(userFromRequest));
            return(Ok());
        }