// GET: /Test/ListCustomer public ActionResult ListCustomer() { var tenantDb = new TenantRegistryEntities(); var appDb = new AppDBEntities(UserProfileHelper.ResolveUserDBConnectionString()); // Register Username and TenantId to memory UserProfileHelper.RegisterUserTenant(); // get tenant id from memory variable var tid = UserProfileHelper.UserTenantLookup[User.Identity.Name].ToString(); var customers = appDb.Customers.Where(c => c.TenantId == tid); return View(customers); }
// GET: /Test/ListAllCustomer public ActionResult ListAllCustomer() { var tenantDb = new TenantRegistryEntities(); var appDb = new AppDBEntities(UserProfileHelper.ResolveUserDBConnectionString()); var customers = appDb.Customers.ToList(); return View(customers); }