我想用Code First&amp ;;设置Entity Framework。迁移 [英] I want to setup Entity Framework with Code First & Migrations

查看:96
本文介绍了我想用Code First&amp ;;设置Entity Framework。迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://msdn.microsoft.com/en-us/data/jj554735.aspx

我以前试过但无法让它工作。

http://msdn.microsoft.com/en-us/data/jj554735.aspx
I tried before but couldn't get it to work.

推荐答案

然后得到一本书, here [ ^ ]。



你无法从论坛或几篇文章中获得关于如何做到这一点的完整教程。有太多的信息要覆盖。
Then get a book on it, here[^].

There is no way you're going to get a full tutorial on how to do it from a forum or a couple of articles. There's just WAY too much information to cover.


你可以在一个简单的控制台应用程序中做到这一点。添加应用程序所需的相应类,然后应用逆向工程。您将获得理解所需的所有逻辑。另外你可以试试MVC应用程序也添加你的类,然后使用schaffolded控制器的CRUD操作。这将生成指定类所需的所有操作和视图。别忘了创建一个DbContext类来存储DbSet<>类的属性。



希望这有帮助

谢谢
you can do that in a simple console application. Add respective classes required for your application and then apply reverse engineering. You will get all the required logic to understand. Else you can try with MVC application also add your classes and then use CRUD operation that is use schaffolded controller. This will generate all the actions and view as required for the classes specified. Dont forget to create a DbContext class to store DbSet<> properties of the classes.

Hope this helps
Thanks


这篇关于我想用Code First&amp ;;设置Entity Framework。迁移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆