예제 #1
0
 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
 public static void RenewContext(ref DbApi context)
 {
     if (context != null)
         context.Dispose();
     context = new DbApi(Cliver.CrawlerHost.Api.GetConnectionString(DATABASE_CONNECTION_STRING_NAME));
 }
 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;
 }