Problem setting nullable in IPropertyConvention
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
Comments are currently closed for this discussion. You can start a new one.
2 Posted by James Spibey on 19 Aug, 2010 02:19 PM
Any help with this? Please?
Support Staff 3 Posted by James Gregory on 19 Aug, 2010 07:19 PM
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:
4 Posted by James Spibey on 19 Aug, 2010 07:38 PM
Good old VB :(
Thanks, that did the trick
James Spibey closed this discussion on 19 Aug, 2010 07:38 PM.