Ejemplo n.º 1
0
        public async Task <IActionResult> DeleteAsync(int Id)
        {
            Response <string> response = new Response <string>();

            try
            {
                response = await _CustomerApplication.DeleteAsync(Id);

                if (response.IsSuccess)
                {
                    return(Ok(response));
                }
                else
                {
                    return(BadRequest(response));
                }
            }
            catch (Exception ex)
            {
                response.Data      = null;
                response.IsSuccess = false;
                response.Message   = ex.Message;

                return(BadRequest(response));
            }
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> DeleteAsync(string customerId)
        {
            if (string.IsNullOrEmpty(customerId))
            {
                return(BadRequest());
            }
            var response = await _customerApplication.DeleteAsync(customerId);

            if (response.IsSuccess)
            {
                return(Ok(response));
            }
            return(BadRequest(response.Message));
        }
        public async Task <IActionResult> DeleteAsync(string dni)
        {
            if (string.IsNullOrWhiteSpace(dni))
            {
                return(BadRequest());
            }

            var response = await application.DeleteAsync(dni);

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

            return(BadRequest(response.Message));
        }