0

In a ASP.net mvc 2 project is there a way to set the default MergeOption to PreserveChanges for all entity types?

Currently i have a massive sub that sets all entity types mergeOption.

Thanks

MattyD
  • 185
  • 1
  • 3
  • 14

2 Answers2

1

I also need to know how to do this. However from my research I agree with Garry English.

To avoid a large routine and have a maintenance free method of setting every entity sets MergeOption have a look at this: Way to automate setting of MergeOptions

Community
  • 1
  • 1
Dave
  • 11
  • 1
0

From what I have read, this cannot be set at design time and can only be set at runtime. Here is a post that shows different ways to set MergeOption:

http://msmvps.com/blogs/kevinmcneish/archive/2010/02/16/setting-entity-framework-mergeoptions-what-works-what-doesn-t.aspx

Garry English
  • 5,070
  • 1
  • 36
  • 23