1

I'm new to .NET, I usually develop in RAILS where this problem is quite simple. I want to create a One-to-Many relationship: a Deal has many Periods. I've implemented Deal and Period models this way:

Public MustInherit Class Deal
    Public Property ID As Integer

    <Display(name:="Código")> <Required> _
    Public Property Code As String

    <Display(name:="Fecha")> <Required> _
    Public Property DealDate As Date

    <Display(name:="Periodos")> <Required> _
    Public Overridable Property Periods() As ICollection(Of Period)
End Class


Public Class Period
    Public Property ID As Integer

    <Display(name:="Fecha")> <Required> _
    Public Property PeriodDate As Date

    <Display(name:="Volumen")> <Required> _
    Public Property Volume As Double

    <Display(name:="Operación")> <Required> _
    Public Overridable Property Deal As Deal
End Class

Most difficult thing is I need to create Period objects inside the Deal form, dinamically. Any Deal can have a variable number of Periods, and periods should be added/removed from the Deal form. Here is an example image taken from the same app, coded in RAILS, that shows how it should be:

enter image description here

I haven't any clue in how to achieve this. Any Tutorial/Help/Clue will be appreciated. Thanks in advance.

Prade Mismo
  • 229
  • 2
  • 13
  • 1
    Some options [here](http://stackoverflow.com/questions/28019793/submit-same-partial-view-called-multiple-times-data-to-controller/28081308#28081308) and [here](http://stackoverflow.com/questions/29161481/post-a-form-array-without-successful/29161796#29161796) –  Aug 07 '15 at 11:05

0 Answers0