Hi,
what is the default pattern using in entity framework?
is it the Simple Entities or Change Set?
Can you give me a simple code for each one?
thanks
Hi,
what is the default pattern using in entity framework?
is it the Simple Entities or Change Set?
Can you give me a simple code for each one?
thanks
Default pattern would be Simple Entities
However, both patterns are supported, and the use would depend on the application. If you want a Change Set pattern i would suggest an alternative "Self-Tracking" entities.
EF supports Simple Entities pattern by allowing you to attach/detach your object from a context by calling Attach/Detach/ApplyPropertyChanges
EF 3.5 makes it a little more challenging to pull of the change set pattern. Because it does not give you means to pass around changes to entities. However if you have the flexibility to use data services you could pull this off.
EF 4 Supports Self-Tracking Pattern by allowing you to customize tracking code that gets generated based on your EF model.
As for the details an examples MS has actually provided a good set of definition of the patterns as well as example implementations
The below blog gives you everything you need.