Ejemplo n.º 1
0
        public async Task <IActionResult> Post([FromBody] RegisterUserModel model)
        {
            var adUser = _adService.FindByEmail(model.Email); //Note: working only in Materialise network - so needed VPN

            var user = _mapper.Map <User>(adUser);
            await _context.Users.AddAsync(user);

            await _context.SaveChangesAsync();

            var result = _mapper.Map <UserModel>(user);

            return(new JsonResult(result)
            {
                StatusCode = 201
            });
        }