public static ContactRequestDto FromContactRequest(ContactRequest contactRequest)
        {
            var model = new ContactRequestDto();

            model.ContactRequestId = contactRequest.ContactRequestId;
            model.Name             = contactRequest.Name;
            return(model);
        }
Ejemplo n.º 2
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     ContactRequest = ContactRequestDto.FromContactRequest(await _context.ContactRequests.FindAsync(request.ContactRequestId))
 };
Ejemplo n.º 3
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     ContactRequests = await _context.ContactRequests.Select(x => ContactRequestDto.FromContactRequest(x)).ToListAsync()
 };