// 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: /Profile/ public ActionResult Index() { // Register Username and TenantId to memory UserProfileHelper.RegisterUserTenant(); var profile = db.UserProfiles.Include("Tenant").SingleOrDefault(u => u.Username == User.Identity.Name); // get tenant id from memory variable var tid = UserProfileHelper.UserTenantLookup[User.Identity.Name].ToString(); var customers = appDb.Customers.Where(c => c.TenantId == tid).ToList(); var models = new ProfileCustomerViewModel { UserProfile = profile, Customers = customers }; return(View(models)); }