Beispiel #1
0
        public async Task <IActionResult> ProductDeleteAsync(
            int model,
            [FromServices] IProductsAppService productsAppService
            )
        {
            if (model is 0 || !ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var search = await productsAppService.ProductyDeleteAsync(model);

            var returnModelView = new BaseViewModel <bool>
            {
                Sucesso  = true,
                Mensagem = search ? messages.PRODUCT_DELETED_SUCCESS():  messages.PRODUCT_DELETED_FAIL(),
            };

            #region .::Log Requests
            loggerService.SaveLoggerSuccess(new LoggerDomain
            {
                objects = JsonConvert.SerializeObject(returnModelView),
                userId  = UsuarioId
            });
            #endregion

            return(Ok(returnModelView));
        }