I’m currently developing a new UWP app for Windows 10. A chance to try the new EntityFramewok 7 (RC2) with SQLite. 😉 Although it is still not final, it works very well. But there are still some strange things. I figured out a problem with the [NotMapped] Data Annotation. At some point I wasn’t able to create migrations anymore.
I tried to add an initial migration with:
But all I got was an exception:
System.NullReferenceException: Object reference not set to an instance of an object.
Poking around in the dark, I tried to replace the Data Annotations with the Fluent-API in my DB-Context like this:
.Ignore(e => e.PropertyToIgnore);
And finally everything worked again! The strange thing is, that not every [NotMapped] caused this problem!? Maybe this will be fixed in future releases… 🙂