开发者

ADO.NET Entity Data Model - MVC - managing one-to-many relations

开发者 https://www.devze.com 2022-12-12 02:10 出处:网络
Let\'s say that I have following situation. I have many customers and many consultans, and each customer has attached only one consultant. So it\'s one-to-many relationship.

Let's say that I have following situation.

I have many customers and many consultans, and each customer has attached only one consultant. So it's one-to-many relationship.

I created Edit view which display customer_name and customer_consultant_id how should I update information after post? Just UpdateModel does not work, so something more开发者_StackOverflow社区 is needed. Any ideas?


To get the data from your web page to the controller, have a look at this article from Scott Hanselman:

ASP.NET Wire Format for Model Binding to Arrays, Lists, Collections, Dictionaries


Those following two links seems to be completly answering my question:

ASP.NET MVC, Entity Framework, One-to-Many and Many-to-Many INSERTS

ASP.NET MVC, Entity Framework, Modifying One-to-Many and Many-to-Many Relationships

0

精彩评论

暂无评论...
验证码 换一张
取 消