I would like to save some work by avoiding having two sets of objects in my code. At the moment, I have the first set, which is just a bunch of surrogate surrogate objects for EF with standard constructors and custom properties so that it can display them. Another is a set of real objects that I use in my business code. The real ones are immutable and fully initialized at creation time using initialization constructors.
Is there a way to avoid surrogates and map directly to real objects using some factories in EF that can deal with initializing constructors without using custom properties?
immutability c # orm entity-framework
Aleksey Bykov
source share