public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     Behaviour = BehaviourApiModel.FromBehaviour(await _context.Behaviours
                                                 .Include(x => x.BehaviourType)
                                                 .SingleAsync(x => x.BehaviourId == request.BehaviourId))
 };
Example #2
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     Behaviours = await _context.Behaviours.Include(x => x.BehaviourType).Select(x => BehaviourApiModel.FromBehaviour(x)).ToListAsync()
 };
Example #3
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     Behaviour = BehaviourApiModel.FromBehaviour(await _context.Behaviours.FindAsync(request.BehaviourId))
 };