Ejemplo n.º 1
0
 public static void ApplyChanges(this DbContext context)
 {
     foreach (var entry in context.ChangeTracker.Entries <IObjectWithState>())
     {
         var objectWithState = entry.Entity;
         if (objectWithState.ObjectState == ObjectState.PartiallyModified)
         {
             HandlePartialUpdate(context, objectWithState, entry);
         }
         else
         {
             var test = ObjectStateHelper.ConvertObjectState(objectWithState.ObjectState);
             entry.State = test;
         }
     }
 }
Ejemplo n.º 2
0
 public void SyncObjectState <T>(T entity) where T : BaseEntity, IObjectState
 {
     this.Entry(entity).State = ObjectStateHelper.ConvertState(entity.ObjectState);
 }
Ejemplo n.º 3
0
 public override void MarkOld()
 {
     base.MarkOld();
     ObjectStateHelper.MarkOld(WorkProfiles);
     ObjectStateHelper.MarkOld(Contact);
 }