Exemplo n.º 1
0
        public async Task <IActionResult> ByEmail(string email)
        {
            User result = await _userService.GetByEmailAsync(email);

            if (result == null)
            {
                return(NotFound());
            }
            return(Ok(result));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Save([FromBody] User user)
        {
            User result = await _userService.AddOrUpdateAsync(user);

            if (result == null)
            {
                return(BadRequest());
            }
            return(Ok(result));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> ById(string id)
        {
            User result = await _userService.GetByIdAsync(id);

            if (result == null)
            {
                return(NotFound());
            }
            return(Ok(result));
        }