如何在脚手架MVC3 asp.net复杂类型? [英] how to scaffold complex types in asp.net mvc3?

查看:132
本文介绍了如何在脚手架MVC3 asp.net复杂类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有了式登录,这只是两个字符串的属性,用户名和密码组成的另一个简单类的属性的用户类。

I have a User class that has a property of type Login, which is just another simple class composed of two string properties, Username and Password.

什么是使添加搭建的信息查看用户类时MVC3脚手架登录属性太正确的(和最佳)的方式?

What would be the correct (and best) way to make MVC3 scaffold the Login property too when adding a Scaffolded View for the User class?

我看到这个问题与此相关的就在这里在计算器上,但问MVC2,因为我读过MVC3脚手架改善了很多,我想知道是否有更好的方法来做到这一点。

I saw this question related to this right here on StackOverflow, but it asked MVC2, and since I've read that MVC3 improved scaffolding a lot, I want to know if there's a better way to do it.

谢谢!

推荐答案

编辑:本文介绍了如何做你要找的究竟(一对多的关系):

This article shows how to do what you're looking for exactly (one to many relationship):

<一个href=\"http://weblogs.asp.net/scottgu/archive/2011/05/05/ef-$c$c-first-and-data-scaffolding-with-the-asp-net-mvc-3-tools-update.aspx\" rel=\"nofollow\">http://weblogs.asp.net/scottgu/archive/2011/05/05/ef-$c$c-first-and-data-scaffolding-with-the-asp-net-mvc-3-tools-update.aspx

史蒂芬·桑德森也疯狂很好用这种东西。看看他有一个MvcScaffolding项目一对多的关系棚架:

Steven Sanderson is also crazy good with this kind of stuff. Check out his MvcScaffolding project with a One to Many relationship scaffolder:

http://blog.stevensanderson.com/2011/01/28/mvcscaffolding-one-to-many-relationships/

这篇关于如何在脚手架MVC3 asp.net复杂类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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