Exemplo n.º 1
0
            public async Task <IEnumerable <IDictionary <string, object> > > Handle(RateTableQueryCommand request, CancellationToken cancellationToken)
            {
                var rates = await preminumFinanceRepository.GetRateTableAll();

                var result = rates.Select(a => (IDictionary <string, object>)a);

                return(result);
            }
Exemplo n.º 2
0
        public async Task <ActionResult <IEnumerable <IDictionary <string, object> > > > GetRateTableAll(RateTableQueryCommand command)
        {
            var result = await mediator.Send(command);

            return(Ok(result));
        }
Exemplo n.º 3
0
        public async Task <ActionResult <IEnumerable <IDictionary <string, object> > > > GetRateTableAll(RateTableQueryCommand command)
        {
            var result = await mediator.Send(command);

            if (!result.IsValid)
            {
                return(BadRequest(result.Errors));
            }
            return(Ok(result.Data));
        }
Exemplo n.º 4
0
            public async Task <WebApiResult <IEnumerable <IDictionary <string, object> > > > Handle(RateTableQueryCommand request, CancellationToken cancellationToken)
            {
                try
                {
                    var rates = await preminumFinanceRepository.GetRateTableAll();

                    var result = rates.Select(a => (IDictionary <string, object>)a);

                    return(new WebApiResult <IEnumerable <IDictionary <string, object> > >(result));
                }
                catch (Exception ex)
                {
                    return(WebApiResult <IEnumerable <IDictionary <string, object> > > .Error(ex.Message));
                }
            }