Ejemplo n.º 1
0
        public IActionResult Delete(int userId)
        {
            if (userId <= 0)
            {
                return(BadRequest());
            }
            var response = _userApplication.Delete(userId);

            if (response.IsSuccess)
            {
                return(Ok(response));
            }

            return(BadRequest(response.Message));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> DeleteUser(
            [HttpTrigger(AuthorizationLevel.Anonymous, "delete", Route = "users/Delete/{id}")] HttpRequestMessage req, string id,
            HttpRequest request, ILogger log)
        {
            var resultAuth = validAdmin(req, request, new List <string>()
            {
                "users.read"
            });

            if (!resultAuth.Success)
            {
                return(new BadRequestObjectResult(resultAuth.Message));
            }

            var dataResult = await _controller.Delete(id);

            if (!dataResult.Success)
            {
                return(new BadRequestObjectResult(dataResult.Message));
            }

            return(new OkObjectResult(dataResult.Value));
        }
Ejemplo n.º 3
0
        public IActionResult OnPostDelete(DeleteUserVM command)
        {
            var result = _userApplication.Delete(command);

            return(new JsonResult(result));
        }
Ejemplo n.º 4
0
        public async Task <MessageHttpResponse> Delete(Guid id)
        {
            await _userApp.Delete(id);

            return(HttpResponse());
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> Delete(int id)
        {
            await _userApplication.Delete(id);

            return(NoContent());
        }
Ejemplo n.º 6
0
 public async Task <IActionResult> Delete(Guid userId)
 {
     return(Ok(await _userApplication.Delete(userId)));
 }