예제 #1
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     Activities = await _context.Activities
                  .Include(x => x.Behaviour)
                  .Include("Behaviour.BehaviourType")
                  .Select(x => ActivityApiModel.FromActivity(x)).ToListAsync()
 };
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     Activity = ActivityApiModel.FromActivity(await _context.Activities
                                              .Include(x => x.Behaviour)
                                              .Include("Behaviour.BehaviourType")
                                              .SingleAsync(x => x.ActivityId == request.ActivityId))
 };
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     Activity = ActivityApiModel.FromActivity(await _context.Activities.FindAsync(request.ActivityId))
 };
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     Activities = await _context.Activities.Select(x => ActivityApiModel.FromActivity(x)).ToListAsync()
 };