예제 #1
0
 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
 }
예제 #2
0
 protected virtual Tenant GetCurrentTenant()
 {
     return(TenantManager.GetByIdAsync(HozaruSession.GetTenantId()).Result);
 }
예제 #3
0
        //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()));
        }