tracker-enabled-dbcontext icon indicating copy to clipboard operation
tracker-enabled-dbcontext copied to clipboard

error saving one to 0-1 relation

Open asbadawi opened this issue 8 years ago • 2 comments

at TrackerEnabledDbContext.Common.Auditors.LogAuditor.GetPrimaryKeyValuesOf(DbEntityEntry dbEntry, List1 properties) at TrackerEnabledDbContext.Common.Auditors.LogAuditor.CreateLogRecord(Object userName, EventType eventType, ITrackerContext context, ExpandoObject metadata) at TrackerEnabledDbContext.Common.CoreTracker.AuditChanges(Object userName, ExpandoObject metadata) at TrackerEnabledDbContext.Identity.TrackerIdentityContext6.SaveChanges(Object userName)

asbadawi avatar Nov 17 '16 12:11 asbadawi

Could you please provide more information.

bilal-fazlani avatar Feb 11 '17 05:02 bilal-fazlani

I've just get exactly the same error.

After all my "EntityTracker.TrackAllProperties<OBJECT>();" setups I have a line with filter for modelBuilder

modelBuilder.Filter("IsDeleted", (ISoftDeletable d) => d.IsDeleted, false);

The problem is that code tried to add new Item to repository with IsDeleted = true and it cause such error. When I removed this filter or fix code not to save items which are isDeleted, everything works fine.

oleksiivasylenko avatar Jul 27 '17 15:07 oleksiivasylenko