Пример #1
0
        public async Task <IActionResult> GetDescription([FromBody] DescriptionDynamicDTO iDynamicDto)
        {
            Response <string> response = new Response <string>();

            if (iDynamicDto == null)
            {
                return(BadRequest());
            }

            response = await _Application.GetDescription(iDynamicDto);

            if (response.IsSuccess)
            {
                return(Ok(response));
            }
            else
            {
                return(BadRequest(response.Message));
            }
        }
Пример #2
0
        public async Task <Response <string> > GetDescription(DescriptionDynamicDTO modelDto)
        {
            var response = new Response <string>();

            try
            {
                var resp = _mapper.Map <DescriptionDynamic>(modelDto);
                response.Data = await _Domain.GetDescription(resp);

                if (response.Data != null)
                {
                    response.IsSuccess = true;
                    response.Message   = "Registro Exitoso!";
                }
            }
            catch (Exception ex)
            {
                response.Data      = string.Empty;
                response.IsSuccess = false;
                response.Message   = ex.Message;
            }

            return(response);
        }