Help me get List<Customers> like following in nhibernate?
Posted
by 07hc420
on Stack Overflow
See other posts from Stack Overflow
or by 07hc420
Published on 2010-06-17T05:05:13Z
Indexed on
2010/06/18
10:33 UTC
Read the original article
Hit count: 130
nhibernate-mapping
I have class following. When i mapping file also following. I only get IList but i have not get List(of OrderTemp). Help me.
Public Class CusTemp Private _CustomerID As String Private _CompanyName As String Private _ContactName As String Private _ContactTitle As String Private _Address As String Private _City As String Private _OrderTemp As List(Of OrderTemp)
Public Sub New()
End Sub
Public Property CustomerID() As String
Get
Return _CustomerID
End Get
Set(ByVal value As String)
_CustomerID = value
End Set
End Property
Public Property CompanyName() As String
Get
Return _CompanyName
End Get
Set(ByVal value As String)
_CompanyName = value
End Set
End Property
Public Property ContactName() As String
Get
Return _ContactName
End Get
Set(ByVal value As String)
_ContactName = value
End Set
End Property
Public Property ContactTitle() As String
Get
Return _ContactTitle
End Get
Set(ByVal value As String)
_ContactTitle = value
End Set
End Property
Public Property Address() As String
Get
Return _Address
End Get
Set(ByVal value As String)
_Address = value
End Set
End Property
Public Property City() As String
Get
Return _City
End Get
Set(ByVal value As String)
_City = value
End Set
End Property
Public Property OrderTemp() As List(Of OrderTemp)
Get
Return _OrderTemp
End Get
Set(ByVal value As List(Of OrderTemp))
_OrderTemp = value
End Set
End Property
End Class
mappingfile:
<!--One-to-many mapping: Orders-->
<bag name="OrderTemp" table="Orders" lazy="true">
<key column="CustomerID" />
<one-to-many class="OrderTemp"/>
</bag>
© Stack Overflow or respective owner