All entity created by EF is partial class. so it is extendable. Suppose I have entity Person like
partial class Person{FirstName, LastName, .....}
Then I want to add a compute property Name like:
partial class Person{
[DataMember]
public string Name
{
get { return String.Format("{0} {1}", this.FirstName, this.LastName); }
}
partial void OnFirstNameChanged()
{
//.....
this.ReportPropertyChanged("Name");
}
partial void OnLastNameChanged()
{
//.....
this.ReportPropertyChanged("Name");
}
//....
}
Then for data upate operation I got following error: The property 'Name' does not have a valid entity mapping on the entity object. For more information, see the Entity Framework documentation.
How to fix this solution?