예제 #1
0
 internal void SaveCreatedAdvert(Advert advert)
 {
     _readModel.Adverts.Add(advert);
     _readModel.Advertisers.Attach(advert.Advertiser);
     _readModel.CatchTypes.Attach(advert.CatchType);
     _readModel.SaveChanges();
 }
예제 #2
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();
     }
 }
예제 #3
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();
     }
 }