Property formula is not working.
Hi,
I'm trying to map a simple formula for a property. Here's the Fluent mapping:
Map(t => t.HasAddress).Formula("(Select Count(*) from dbo.Address Where Address.Person = Id)");
This bombs, seemingly while it's evaluating our NotNull convention. The error is that there is an incomplete mapping; the inner exception is from Linq to Objects, Sequence contains no elements.
Also, we are on a slightly modified branch from 4/10, due to this issue: https://fluentnhibernate.tenderapp.com/discussions/help/164-convent...
Thanks
Andy
2 Posted by steve on 09 Dec, 2010 09:39 AM
I'm also experiencing this with the 1.1 release (unmodified). We have a simple property convention that defines NotNull:
And I've defined a Formula based mapping:
This throws an InvalidOperationException at startup:
I hope this helps!
3 Posted by steve on 09 Dec, 2010 09:42 AM
It's failing here (PropertyInstance.cs):
mapping.Columns.First() throws InvalidOperationException here because mapping.Columns contains no entries.