Beispiel #1
0
 public void Delete(Car entity)
 {
     using (MasterContext context = new MasterContext())
     {
         var deletedEntity = context.Entry(entity);
         deletedEntity.State = EntityState.Deleted;
         context.SaveChanges();
     }
 }
Beispiel #2
0
 public void Update(Car entity)
 {
     using (MasterContext context = new MasterContext())
     {
         var UpdatedEntity = context.Entry(entity);
         UpdatedEntity.State = EntityState.Modified;
         context.SaveChanges();
     }
 }
Beispiel #3
0
 public void Add(Car entity)
 {
     using (MasterContext context = new MasterContext())
     {
         var addedEntity = context.Entry(entity);
         addedEntity.State = EntityState.Added;
         context.SaveChanges();
     }
 }