Dkong
Dkong

Reputation: 2788

lack of separation of EF poco

I like EF but poco classes with attributes still seem like they are too tightly coupled to the framework. If I want to use those same Poco classes for something other than EF those attributes may have no use or meaning.

Is there a way to deal with this?

Upvotes: 0

Views: 51

Answers (2)

MaxSC
MaxSC

Reputation: 4738

Your POCO won't be tightly coupled anymore if you switch from Data Annotations the Fluent API.

Have a look at this SO aswer where I explained how to proceed.

Upvotes: 1

undefined
undefined

Reputation: 34238

Yes what you are looking for is modelbuilder configuration. This leaves all entites completely POCO. Check out my blog article here as a bit of a starting point http://blog.staticvoid.co.nz/2012/7/17/entity_framework-navigation_property_basics_with_code_first in the second half of the article i discuss some of the basics of the modelbuilder. There are plenty of more specific tutorials on the modelbuilder and how to use it online

Upvotes: 0

Related Questions