Exemple #1
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 {
     return(new Response()
     {
         Tenants = await _context.Tenants.Select(x => TenantApiModel.FromTenant(x)).ToListAsync()
     });
 }
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 {
     return(new Response()
     {
         Tenant = TenantApiModel.FromTenant(await _context.Tenants.FindAsync(request.Id))
     });
 }
        public static TenantApiModel FromTenant(Tenant tenant)
        {
            var model = new TenantApiModel();

            model.TenantId = tenant.TenantId;
            model.Name     = tenant.Name;
            return(model);
        }