protected virtual void CheckAndSetMustHaveTenant() { if (this.IsFilterEnabled(HozaruDataFilters.MustHaveTenant)) { return; } if (HozaruSession.TenantId == null) { return; } ApplyEnableFilter(HozaruDataFilters.MustHaveTenant); //Enable Filters ApplyFilterParameterValue(HozaruDataFilters.MustHaveTenant, HozaruDataFilters.Parameters.TenantId, HozaruSession.GetTenantId()); //ApplyFilter }
protected virtual Tenant GetCurrentTenant() { return(TenantManager.GetByIdAsync(HozaruSession.GetTenantId()).Result); }
//protected virtual Task<User> GetCurrentUserAsync() //{ // var user = UserManager.FindByIdAsync(HozaruSession.GetUserId()); // if (user == null) // { // throw new ApplicationException("There is no current user!"); // } // return user; //} protected virtual Task <Tenant> GetCurrentTenantAsync() { return(TenantManager.GetByIdAsync(HozaruSession.GetTenantId())); }