Пример #1
0
 private static void InitializeFilterLists(FilterListsDbContext filterListsDbContext)
 {
     if (filterListsDbContext.FilterLists.Any())
     {
         return;
     }
     filterListsDbContext.AddRange(JsonConvert.DeserializeObject <List <FilterList> >(
                                       File.ReadAllText(Path.GetFullPath(Path.Combine(AppContext.BaseDirectory + @"\",
                                                                                      @"..\..\..\..\..\data\ListsSeed.json")))));
     filterListsDbContext.SaveChanges();
 }
Пример #2
0
 public static void Initialize(FilterListsDbContext filterListsDbContext)
 {
     filterListsDbContext.Database.Migrate();
     InitializeLanguages(filterListsDbContext);
     InitializeFilterLists(filterListsDbContext);
 }