lfaldanam / sharp-architecture

Automatically exported from code.google.com/p/sharp-architecture
Other
0 stars 0 forks source link

One-To-Many support for SharpModelBinder #105

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This patch extend the support for one-to-many properties.

*Your model has to look like this:*

public class [Order]
  IEnumerable/ICollection/IList<[OrderLine]> [OrderLines] {get; private set;}
  Add[OrderLines](IEnumerable<OrderLine> ...) or 
  Add[OrderLine](OrderLine ...)

*You have to use any of these two options:*
  Add[Collection Property Name] (IEnumerable of item type)
  Add[Item type name] (item type)

*Your html form has to look like this:*

 "Customer","..."
 "OrderLine[0]_Product"
 "OrderLine[0]_Price"
 "OrderLine[0]_Quantity"
 "OrderLine[1]_Product"
 "OrderLine[1]_Price"
 "OrderLine[1]_Quantity"

This convention has been taken from various example of mvc model binding.
Google keywords: variable length asp.net mvc

Original issue reported on code.google.com by jfromani...@gmail.com on 5 Jun 2009 at 4:03

Attachments:

GoogleCodeExporter commented 9 years ago
sorry.
*Your html form has to look like this:*

 "Customer","..."
 "OrderLines[0]_Product"
 "OrderLines[0]_Price"
 "OrderLines[0]_Quantity"
 "OrderLines[1]_Product"
 "OrderLines[1]_Price"
 "OrderLines[1]_Quantity"

Original comment by jfromani...@gmail.com on 5 Jun 2009 at 4:04

GoogleCodeExporter commented 9 years ago
I just want to kill this patch and shoot myself. I've figured out the problem 
with my
app and now sharpmodelbinder is working excelent without anything of this.

Original comment by jfromani...@gmail.com on 9 Jun 2009 at 11:39

GoogleCodeExporter commented 9 years ago
Well please don't shoot yourself. ;)

Original comment by wmccaffe...@gmail.com on 17 Jun 2009 at 3:01