Skip to content

Commit

Permalink
resolved #1058
Browse files Browse the repository at this point in the history
  • Loading branch information
ismcagdas committed Jun 1, 2016
1 parent 4efa10f commit 2c31623
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Abp.EntityFramework/EntityFramework/Uow/EfUnitOfWork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,13 @@ protected virtual void Release(DbContext dbContext)
private static void ObjectContext_ObjectMaterialized(DbContext dbContext, ObjectMaterializedEventArgs e)
{
var entityType = ObjectContext.GetObjectType(e.Entity.GetType());
var previousState = dbContext.Entry(e.Entity).State;

dbContext.Configuration.AutoDetectChangesEnabled = false;

DateTimePropertyInfoHelper.NormalizeDatePropertyKinds(e.Entity, entityType);

dbContext.Entry(e.Entity).State = previousState;
dbContext.Entry(e.Entity).State = EntityState.Unchanged;
dbContext.Configuration.AutoDetectChangesEnabled = true;
}
}
}

0 comments on commit 2c31623

Please sign in to comment.