Closed haseebfurkhan closed 7 years ago
Hi,
I am using the following code to update my object in MVC application
db.Entry(myObject).State = EntityState.Modified; db.SaveChanges();
There are no entries getting saved to AuditLogs or AuditLogDetails tables even though I've made changes to some of the values.
When I create a new record, the changes are getting audited to both the tables.
Tried both TrackerEnabledDbContextv3.6.1 and TrackerEnabledDbContext.Identity v3.6.1
MVC 5.2.2 EntityFramework 6.1.3
Please let me know if I am doing something wrong here, or need to configure more things.
Figured it out.
In DB context constructor, set DisconnectedContext to true.
public ApplicationDbContext() : base("DefaultConnection") { GlobalTrackingConfig.DisconnectedContext = true; }
Hi,
I am using the following code to update my object in MVC application
There are no entries getting saved to AuditLogs or AuditLogDetails tables even though I've made changes to some of the values.
When I create a new record, the changes are getting audited to both the tables.
Tried both TrackerEnabledDbContextv3.6.1 and TrackerEnabledDbContext.Identity v3.6.1
MVC 5.2.2 EntityFramework 6.1.3
Please let me know if I am doing something wrong here, or need to configure more things.