public static SaltieDataProvider LoadProvider() { _provider = SueetieCache.Current[providerKey] as SaltieDataProvider; if (_provider == null) { lock (_lock) { if (_provider == null) { SueetieConfiguration sueetieConfig = SueetieConfiguration.Get(); List <SueetieProvider> sueetieProviders = sueetieConfig.SueetieProviders; SueetieProvider _p = sueetieProviders.Find(delegate(SueetieProvider sp) { return(sp.Name == "SaltieSqlDataProvider"); }); _provider = Activator.CreateInstance(Type.GetType(_p.ProviderType), new object[] { _p.ConnectionString }) as SaltieDataProvider; SueetieCache.Current.InsertMax(providerKey, _provider, new CacheDependency(sueetieConfig.ConfigPath)); } } } return(_provider); }
public static int GetContentCount(int userid) { SaltieDataProvider _provider = SaltieDataProvider.LoadProvider(); return(_provider.GetContentCount(userid)); }