简体   繁体   English

学习CRUD ASP.net MVC4

[英]Learning CRUD ASP.net mvc4

Currently converting my mvc windows forms app into a asp.net mvc4. 目前将我的mvc Windows窗体应用程序转换为asp.net mvc4。 MY database consists of four different tables. MY数据库包含四个不同的表。 I can create crud controllers based on any table in the db as well as the view as i understand. 我可以根据数据库中的任何表以及我所了解的视图创建Crud控制器。 I taught one could create a single controller with crud for all tables but does not seem possible?! 我教过一个人可以为所有表创建一个带有crud的控制器,但这似乎不可能吗? I was wondering this as i want my views to be able to CRUD more than one table? 我想知道这是因为我希望我的视图能够对多个表进行CRUD吗? How does one do this? 如何做到这一点? The only way i could do this i think is to create my respective views/pages accessible by action methods from the Home controller. 我认为这样做的唯一方法是创建可通过Home控制器的操作方法访问的各自视图/页面。 Then each of these views could redirect to a specific CRUD controller created for each table? 然后,每个视图都可以重定向到为每个表创建的特定CRUD控制器? Thanks for any suggestions in advance. 感谢您提前提出任何建议。 Also any links or posts that could help my luarning path would be greatly appreciated. 同样,任何可以帮助我学习的链接或帖子也将不胜感激。

I have decided to follow the advice in another post : Pass more than one model to view 我决定遵循另一篇文章中的建议: 通过多个模型进行查看

Also as regards CRUD methods, for the time being i will use the classes i have already created in the previous incarnation of my project as a windows forms mvc. 关于CRUD方法,暂时我将使用在我的项目的前身中已经创建的类作为Windows窗体mvc。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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