-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyNotFoundException in DatabaseFirst #108
Comments
Show me your dbcontext code. And its happening while saving a particular entity or all entities ? |
The exception occurs only when there is changes in the entity, but the same exception for all entities, yes. |
This looks pretty normal... except for the fact that its auto generated. Are you using code first ? Can u show me the code for above entities ? On Wed 25 May, 2016 9:49 pm pointlevel, notifications@github.com wrote:
|
Hello! Im using DataBase first and the models are generated automatic from the DB. Is that a problem? |
This library works with code first only. |
I did some debugging to find out why its crashing with that exception and I found that its a bug in EntityFramework.MappingApi library. https://efmappingapi.codeplex.com/workitem/1825 I have raised a bug there. |
Great discover, hopefully they will fix it, or i have to change to Code First! |
Hello!
I get a KeyNotFoundException "Key not found for TestProject.Setting" when trying to use the tracker.
Stacktrace:
vid TrackerEnabledDbContext.Common.Auditors.LogAuditor.GetPrimaryKeyValuesOf(DbEntityEntry dbEntry, List`1 properties)
vid TrackerEnabledDbContext.Common.Auditors.LogAuditor.CreateLogRecord(Object userName, EventType eventType, ITrackerContext context)
vid TrackerEnabledDbContext.Common.CoreTracker.AuditChanges(Object userName)
vid TrackerEnabledDbContext.TrackerContext.SaveChanges(Object userName)
vid TrackerEnabledDbContext.TrackerContext.SaveChanges()
My table has a primary key, and i have tried also with annotations, no difference. Tried to track other tables but with same result. Im using EF 6. Any ideas?
The text was updated successfully, but these errors were encountered: