简体   繁体   中英

Have a class/object with a lot of properties, how do I automatically generate a table in edmx of Entity Framework?

Surely this is out there (or maybe you just can't do this?).

I have a class in my project with a bunch of properties. I already have an edmx with two tables in it. How do I automatically make a third table for this new class. I don't want to manually add 40 properties to a new table.

I realize this isn't a great answer, but I know the newer versions of EF (4+ I think) support "code first" entities. I've never used this feature, but a quick google search for "Code First Entity Framework" may give you the answer you seek.

Edit: here's a link to Scott Gu's blog on the feature (which is where I read about it originally): http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-with-entity-framework-4.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM