I'm creating a Database using the Microsoft Entity Framework and CodeFirst in C#. I want to use the Database in a WPF-Application, so the Entity-Classes should implement "INotifyPropertyChanged".
This can be done very elegantly using a PostSharp aspect, which triggers the PropertyChanged event automatically every time a property changes. If I create such an aspect and use it on my entity classes, I get the following exeption when trying to create the Database:
System.Data.Entity.Edm.EdmNavigationProperty: Name: The specified name is not allowed: '<Name>k__BackingField'.
Obviously PostSharp creates a property called "k__BackingField" which causes the database creation to fail, because it's an invalid name from the EntityFramework's point of view. Is there any way to circumvent this error without manually implementing "INotifyPropertyChanged" in every single Entity-Class?
P.S: English is not my native language, I would be very thankful if you informed me about possible mistakes in my postings.
Thank you in advance
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…