Beispiel #1
0
 public async Task <GetDocumentByIdResponse> Handle(GetDocumentByIdRequest request)
 {
     return(new GetDocumentByIdResponse()
     {
         Document = DocumentApiModel.FromDocument(await _context.Documents.SingleAsync(x => x.Id == request.Id && x.TenantId == request.TenantId))
     });
 }
Beispiel #2
0
            public async Task <GetDocumentsResponse> Handle(GetDocumentsRequest request)
            {
                var documents = await _context.Documents
                                .Where(x => x.TenantId == request.TenantId)
                                .ToListAsync();

                return(new GetDocumentsResponse()
                {
                    Documents = documents.Select(x => DocumentApiModel.FromDocument(x)).ToList()
                });
            }