コード例 #1
0
ファイル: DbApi.cs プロジェクト: sergeystoyan/FhrCliverHost
 public static void RenewContext(ref DbApi context)
 {
     if (context != null)
     {
         context.Dispose();
     }
     context = new DbApi(Cliver.CrawlerHost.Api.GetConnectionString(DATABASE_CONNECTION_STRING_NAME));
 }
コード例 #2
0
ファイル: DbApi.cs プロジェクト: sergeystoyan/FhrCliverHost
 public static void RenewContext(ref DbApi context)
 {
     if (context != null)
         context.Dispose();
     context = new DbApi(Cliver.CrawlerHost.Api.GetConnectionString(DATABASE_CONNECTION_STRING_NAME));
 }
コード例 #3
0
 public static Dictionary<string, dynamic> GetCompanyCategories(DbApi db, int company_id)
 {
     List<string> categories = db.Products.Where(p => p.CompanyId == company_id).GroupBy(p => p.Category).Select(c => c.Key).ToList();
     Dictionary<string, dynamic> tree = build_tree_from_paths(categories);
     return tree;
 }