public static bool Authenticate(ITokenServiceModel token)
 {
     try
     {
         var userSettings   = UserSettingsService.GetUserSettings(token);
         var masterSettings = MasterSettingsService.GetMasterSettings();
         return(Authenticate(token, masterSettings, userSettings));
     }
     catch
     {
         return(false);
     }
 }
Esempio n. 2
0
        public static List <T> GetUsers <T>(Func <T, bool> userSettingsFilterCondition) where T : class, IUserSettingsViewModel
        {
            var cacheHelper      = CacheHelperFactory.GetDefinedCacheHelper();
            var userSettings     = new List <T>();
            var userSettingsKeys = cacheHelper.GetCacheKeys().Where(w => w.Contains(Constants.UserSettingsCacheName));

            foreach (var key in userSettingsKeys)
            {
                var userSetting = UserSettingsService.GetUserSettings(key) as T;
                if (!(userSettingsFilterCondition?.Invoke(userSetting)) ?? true)
                {
                    continue;
                }
                userSettings.Add(userSetting);
            }
            return(userSettings);
        }