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.
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?
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.
Thanks!
EDIT: This article shows how to do what you're looking for exactly (one to many relationship):
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/
来源:https://stackoverflow.com/questions/5864939/how-to-scaffold-complex-types-in-asp-net-mvc3