コード例 #1
0
        private Guid RetornarExtratoComExcecaoSeNulo(Guid participanteId)
        {
            var extratoId = extratoReadModelService.RetornarIdExtrato(participanteId);

            if (!extratoId.HasValue)
            {
                throw new InvalidOperationException($"O extrato {extratoId} não existe.");
            }
            return(extratoId.Value);
        }
コード例 #2
0
        private async Task <Resultado <Guid> > RetornarExtrato(Guid participanteId)
        {
            var extratoId = await extratoReadModelService.RetornarIdExtrato(participanteId);

            Resultado <Guid> resultado;

            resultado = !extratoId.HasValue ?
                        new Resultado <Guid>(false, $"O extrato {extratoId} não existe.") :
                        new Resultado <Guid>(extratoId.Value);

            return(await Task.FromResult(resultado));
        }
コード例 #3
0
        public async Task <bool> ExisteExtratoParticipante(Guid participanteId)
        {
            var resultado = await extratoParticipanteReadModelService.RetornarIdExtrato(participanteId);

            return(resultado.HasValue);
        }
コード例 #4
0
 public bool ExisteExtratoParticipante(Guid participanteId)
 {
     return(extratoParticipanteReadModelService.RetornarIdExtrato(participanteId).HasValue);
 }