Problem setting nullable in IPropertyConvention

James Spibey's Avatar

James Spibey

09 Aug, 2010 11:33 AM via web

Hi,

I've come upon a strange issue when trying to create a convention to map Non Null columns. I've tested this on build 689 and get the same problem. The code is as follows

Public Class RequiredConvention
    Implements IPropertyConvention
    Implements IPropertyConventionAcceptance

    Public Sub Accept(ByVal criteria As FluentNHibernate.Conventions.AcceptanceCriteria.IAcceptanceCriteria(Of FluentNHibernate.Conventions.Inspections.IPropertyInspector)) Implements FluentNHibernate.Conventions.IConventionAcceptance(Of FluentNHibernate.Conventions.Inspections.IPropertyInspector).Accept
        criteria.Expect(Function(x) x.Property.MemberInfo.IsDefined(GetType(RequiredAttribute), False))
    End Sub

    Public Sub Apply(ByVal instance As IPropertyInstance) Implements IConvention(Of FluentNHibernate.Conventions.Inspections.IPropertyInspector, FluentNHibernate.Conventions.Instances.IPropertyInstance).Apply

        instance.Not.Nullable()

    End Sub

End Class

The error I receive is

Error 2 'Nullable' is ambiguous across the inherited interfaces 'FluentNHibernate.Conventions.Inspections.IPropertyInspector' and 'FluentNHibernate.Conventions.Instances.INullableInstance'. E:\Data\Dev\TS\EDC\Trunk\Repository\Mappings\SM\Conventions\RequiredConvention.vb

Any ideas what I'm doing wrong?

Thanks

James

  1. 2 Posted by James Spibey on 19 Aug, 2010 02:19 PM

    James Spibey's Avatar

    Any help with this? Please?

  2. Support Staff 3 Posted by James Gregory on 19 Aug, 2010 07:19 PM

    James Gregory's Avatar

    Using VB, I'm afraid.

    Try explicitly casting instance to INullableInstance.

    On Thu, Aug 19, 2010 at 3:21 PM, James Spibey <
    ***@tenderapp.com<tender%***@tenderapp.com>
    > wrote:

  3. 4 Posted by James Spibey on 19 Aug, 2010 07:38 PM

    James Spibey's Avatar

    Good old VB :(

    Thanks, that did the trick

  4. James Spibey closed this discussion on 19 Aug, 2010 07:38 PM.

Comments are currently closed for this discussion. You can start a new one.