Beispiel #1
0
        public async Task <Response> Handle(ObterTaxaCobrancaPorSegmentoQuery request, CancellationToken cancellationToken)
        {
            var tipoSegmento = TipoSegmento.ObterPorIdIf(request.TipoSegmento);

            if (tipoSegmento is null)
            {
                return(Response.Fail(Errors.General.NotFound(nameof(TipoSegmento), request.TipoSegmento)));
            }

            var taxaSegmento = await _cacheService.GetCacheValueAsByte($"BYTE-{tipoSegmento.Id}");

            if (taxaSegmento is null)
            {
                return(Response.Fail(Errors.General.NotFound(nameof(TipoSegmento), tipoSegmento.Id)));
            }

            return(Response.Ok(ResponseContent.Create(taxaSegmento, typeof(TaxaResponse))));
        }
Beispiel #2
0
        public void ObterPorId_SOLUCAO_5()
        {
            var tipoSegmento = TipoSegmento.ObterPorIdIf("private");

            Debug.WriteLine(tipoSegmento);
        }