I have two classes in my MVC project Orderand Product.
Since Productyou can order many times, and Ordercan have many products, I have a third entity, which OrderedProduct. He combines these two objects in many ways.
Now what I'm trying to do is give the user the opportunity to place an order by putting products from the drop-down list in the box, and then save my order. In addition, the client must fill in some files in the Order entity, such as address data, etc. All I want is all on one page. The user can add as many items from the drop-down list as he wants, then he can add the entire order.
To simplify the visualization, look at this image:
Layout http://img245.imageshack.us/img245/4618/myimage.png
Now the problem is how to implement this behavior in my MVC application. Should I create a ViewModel that combines a class Orderand a list Productor uses a partial view for classes Product?
Just like my main problem , how can I (in an elegant way) get a complete list of selected products or at least the product identifier in the controller after a POST request? In this case, how can I indicate that what I'm sending is a set of identifiers? Just add one object, but what about an entire collection?
This is a place where I do not fully understand asp.net MVC, so please give me some bright ideas;) I welcome you all, thanks for the consultation for all your answers!
source
share