Пример #1
0
 public async Task <GetSubscriptionByIdResponse> Handle(GetSubscriptionByIdRequest request)
 {
     return(new GetSubscriptionByIdResponse()
     {
         Subscription = SubscriptionApiModel.FromSubscription(await _context.Subscriptions
                                                              .SingleAsync(x => x.Id == request.Id))
     });
 }
            public async Task <Response> Handle(Request request)
            {
                var subscriptions = await _context.Subscriptions
                                    .ToListAsync();

                return(new Response()
                {
                    Subscriptions = subscriptions.Select(x => SubscriptionApiModel.FromSubscription(x)).ToList()
                });
            }