Ejemplo n.º 1
0
            public async Task <CQRSResult <AuthorGetDTO> > Handle(AuthorQuery request, CancellationToken cancellationToken)
            {
                var author = uow.AuthorsRepository.GetById(request.Id);

                if (author != null)
                {
                    return(AuthorGetMap.ToDTO(author));
                }
                else
                {
                    return((null as AuthorGetDTO).AsCQRSResult(code: 404));
                };
            }
Ejemplo n.º 2
0
            public async Task <CQRSResult <AuthorGetDTO> > Handle(AuthorQuery request, CancellationToken cancellationToken)
            {
                var author = uow.AuthorsRepository.GetById(request.Id);

                if (author != null)
                {
                    return(mapper.Map <AuthorGetDTO>(author));
                }
                else
                {
                    return((new AuthorGetDTO {
                        Id = request.Id
                    })
                           .AsResult(code: 404));
                }
            }