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

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