Ejemplo n.º 1
0
        public async Task <GetAllPrintTemplatesResponse> Handle(GetAllPrintTemplatesRequest request, CancellationToken cancellationToken)
        {
            var errorMessage = string.Empty;
            List <PrintTemplate> response = new List <PrintTemplate>();

            try
            {
                response = await _infoServiceWrapper.GetAllPrintTemplates(request.AccountId);
            }
            catch (Exception ex)
            {
                errorMessage = ex.Message;
            }
            return(await Task.FromResult(new GetAllPrintTemplatesResponse
            {
                Success = string.IsNullOrEmpty(errorMessage) ? true : false,
                ErrorMessage = errorMessage,
                PrintTemplateList = response
            }));
        }