VB does have lambda statements, just not lambda blocks. Which means you are
able to use the property mappings, just not the more complex ones.
Until VB supports lambda blocks, we don't support VB.

However, if you really want to use FNH with VB, and you're willing to put up
with a bit of ugliness you can use the traditional VB delegate style:

Public Class Customer
    Private _id As Integer

    Public Property Id() As Integer
        Get
            Return _id
        End Get
        Set(ByVal value As Integer)
            _id = value
        End Set
    End Property

    Private _address As Address

    Public Property Address() As Address
        Get
            Return _address
        End Get
        Set(ByVal value As Address)
            _address = value
        End Set
    End Property

End Class

Public Class Address
    Private _street As String

    Public Property Street() As String
        Get
            Return _street
        End Get
        Set(ByVal value As String)
            _street = value
        End Set
    End Property
End Class

Public Class CustomerMap
    Inherits ClassMap(Of Customer)

    Public Sub New()
        Id(Function(x) x.Id)
        Component(Of Address)(Function(x) x.Address, AddressOf
AddressComponent)
    End Sub

    Private Sub AddressComponent(ByVal c As ComponentPart(Of Address))
        c.Map(Function(x) x.Street)
    End Sub
End Class

On Wed, Feb 4, 2009 at 3:21 PM, Benjamin Geiger <benjamingei...@gmail.com>wrote:

>
> Due to managerial fiat, I am forced to write in VB.NET.  VB.NET does
> not have lambda statements (as of VS 2008).
>
> Many examples of FNH mappings seem to require lambda statements
> (particularly when involving components).  Is there an alternate
> syntax for these, suitable for use in VB.NET?
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibernate@googlegroups.com
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to