Exemplo n.º 1
0
 private void PrepareObjectGraph(Seller seller, DataContext context)
 {
     context.Sellers.Add(seller);
 }
Exemplo n.º 2
0
 private void MarkSellerAsModified(Seller seller, DataContext context)
 {
     context.Entry(seller).State = EntityState.Modified;
 }
Exemplo n.º 3
0
 private void DeleteExistingProperties(Seller seller, DataContext context)
 {
     context.Database.ExecuteSqlCommand("DELETE from SellerProperties where SellerId = " + seller.SellerId);
 }
Exemplo n.º 4
0
 private void MarkAllPropertiesAsNew(Seller seller, DataContext context)
 {
     seller.Properties.ForEach(x => context.Entry(x).State = EntityState.Added);
 }
Exemplo n.º 5
0
 private void UpdateSeller(Seller seller, DataContext context)
 {
     PrepareObjectGraph(seller, context);
     MarkSellerAsModified(seller, context);
     DeleteExistingProperties(seller, context);
     MarkAllPropertiesAsNew(seller, context);
 }