where should I put the EF entity and data annotations in asp.net mvc + entity framework project

Posted by giddy on Stack Overflow See other posts from Stack Overflow or by giddy
Published on 2010-12-21T05:26:18Z Indexed on 2010/12/21 5:31 UTC
Read the original article Hit count: 265

So I have a DataEntity class generated by EntityFramework4 for my sqlexpress08 database. This data context is exposed via a WCF Data Service/Odata to silverlight and win forms clients.

Should the data entities + edmx file (generated by EF4) go in a separate class library?

The problem here then is I would specify data annotations for a few entities and then some of them would require specific MVC attributes (like CompareAttribute) so the class library would also reference mvc dlls. There also happen to be entity users which will be encapsulated or wrapped into an IIdentity in the website. So its pretty tied to the mvc website. Or Should it maybe go in a Base folder in the mvc project itself?

Mostly the website is data driven around the database, like approve users, change global settings etc. The real business happens in the silverlight and win forms apps.

Im using mvc3 rc2 with Razor.
Thanks

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about entity-framework