Esempio n. 1
0
 private static void AddAdvertisers(AdvertisingDbContext context)
 {
     if (context.Advertisers.Count() == 0)
     {
         context.Advertisers.Add(new Advertiser(1, "Nina"));
         context.Advertisers.Add(new Advertiser(2, "Fred"));
         context.SaveChanges();
     }
 }
Esempio n. 2
0
 private static void AddCatchTypes(AdvertisingDbContext context)
 {
     if (context.CatchTypes.Count() == 0)
     {
         context.CatchTypes.Add(new CatchType(1, "Lobster"));
         context.CatchTypes.Add(new CatchType(2, "Cod"));
         context.CatchTypes.Add(new CatchType(3, "Halibut"));
         context.SaveChanges();
     }
 }
Esempio n. 3
0
 public AdvertRepository(AdvertisingDbContext readModel, IEventStoreConnection writeModel)
 {
     _readModel  = readModel;
     _writeModel = writeModel;
     _writeModel.ConnectAsync();
 }
Esempio n. 4
0
 private static void EnsureDBIsCreated(AdvertisingDbContext context)
 {
     context.Database.Migrate();
 }
Esempio n. 5
0
 public static void SeedData(this AdvertisingDbContext context)
 {
     EnsureDBIsCreated(context);
     AddCatchTypes(context);
     AddAdvertisers(context);
 }
Esempio n. 6
0
        private readonly AdvertisingDbContext _dataSource; // Change to REDIS

        public LookupCacheProvider(AdvertisingDbContext dataSource)
        {
            _dataSource = dataSource;
        }