KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
What exactly does the EntityFramework do to map properties that have custom getters and setters when using Code First? Does it simply call the getter for a property when serializing, and the setter when deserializing? So I could do something silly like... public class Foo { public DateTime TimeAccessed { get { return DateTime.Now; } set { TimeDeserialized = DateTime.Now; } } [NotMapped] public DateTime TimeDeserialized { get; private set; } } Note I have no actual interest in using the above code, or anything like it... it's for illustrative purposes only. Also, when mapping a property with Code First, do all getters and setters need to be public ?
Tags (comma-separated)
Save Edits
Cancel