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

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