w*******7 发帖数: 188 | 1 You can use "Entity Framework" to create a model from a database, WPF and
Window Form can consume this model. I am not sure about Webform (I think it
could).
But for MVC, the reverse engineering model is used ObjectSet and Objectquery
, Is there any way to implement the model directly in MVC as Data Domain?
Or you have to use code first to build the data model and set connectting
string to direct connect to database? | H*******g 发帖数: 6997 | 2 Data Respository
LLBLGEN FTW | k****i 发帖数: 1072 | 3 POCO
it
Objectquery
【在 w*******7 的大作中提到】 : You can use "Entity Framework" to create a model from a database, WPF and : Window Form can consume this model. I am not sure about Webform (I think it : could). : But for MVC, the reverse engineering model is used ObjectSet and Objectquery : , Is there any way to implement the model directly in MVC as Data Domain? : Or you have to use code first to build the data model and set connectting : string to direct connect to database?
| w*******7 发帖数: 188 | 4 According to Julie's blog, if you use EF5 and VS2012, you can "uses a code
generator that spits out POCO entity classes managed by a DbContext by
default rather than the EntityObject based classes managed by the
ObjectCpntext as it did for VS2008 and VS2010."
http://thedatafarm.com/blog/data-access/getting-started-with-ef
I used "code first" to build a db and use "DB first" to reverse-engineering
a model (You can use such as model.tt to rebuild you data model) and
compared with previous class, basically you can not directly to use them (no
annotation etc...).
But it gives you a reference to build "code first" model, I think so far "
code first" should be first choose for your MVC project.
【在 k****i 的大作中提到】 : POCO : : it : Objectquery
| k****i 发帖数: 1072 | 5 Tool肯定有,免费的收费的自己找找。
除非你有很多existing tables.I prefer to write the POCO classes myself.
engineering
no
【在 w*******7 的大作中提到】 : According to Julie's blog, if you use EF5 and VS2012, you can "uses a code : generator that spits out POCO entity classes managed by a DbContext by : default rather than the EntityObject based classes managed by the : ObjectCpntext as it did for VS2008 and VS2010." : http://thedatafarm.com/blog/data-access/getting-started-with-ef : I used "code first" to build a db and use "DB first" to reverse-engineering : a model (You can use such as model.tt to rebuild you data model) and : compared with previous class, basically you can not directly to use them (no : annotation etc...). : But it gives you a reference to build "code first" model, I think so far "
|
|