コード例 #1
0
 public override async Task <Customer> Handle(BaseGetQuery <Customer> request, CancellationToken cancellationToken)
 {
     return(await _set
            .Where(e => e.Id == request.Id)
            .Include(e => e.Cart)
            .SingleAsync(cancellationToken));
 }
コード例 #2
0
 public virtual async Task <TEntity> Handle(BaseGetQuery <TEntity> request, CancellationToken cancellationToken)
 {
     if (request.Track)
     {
         return(await _set.FindAsync(new object[] { request.Id }, cancellationToken));
     }
     else
     {
         return(await _set.AsNoTracking().SingleAsync(e => e.Id == request.Id, cancellationToken));
     }
 }