public async Task <Response> Handle(Request request) { return(new Response() { Account = AccountApiModel.FromAccount(await _context.Accounts .Include(x => x.Tenant) .SingleAsync(x => x.Id == request.Id && x.Tenant.UniqueId == request.TenantUniqueId)) }); }
public async Task <Response> Handle(Request request) { var accounts = await _context.Accounts .Include(x => x.Tenant) .Where(x => x.Tenant.UniqueId == request.TenantUniqueId) .ToListAsync(); return(new Response() { Accounts = accounts.Select(x => AccountApiModel.FromAccount(x)).ToList() }); }