Current I have something like this
public class FormularConvention :
AttributePropertyConvention<FormularAttribute>
{
#region Overrides of AttributePropertyConvention<FormularAttribute>
protected override void Apply(FormularAttribute attribute,
IPropertyInstance instance)
{
instance.Formula(attribute.Formular);
}
#endregion
}
pretty basic stuff, and the following got generated
<property name="TotalEnrollmentCount" formula="(Select Count(*) From
Enrollments e where e.UserFk = Id and e.IsInActive ='0')"
type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089">
<column name="TotalEnrollmentCount" />
</property>
where it should be
<property name="TotalEnrollmentCount" formula="(Select Count(*) From
Enrollments e where e.UserFk = Id and e.IsInActive ='0')"
type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089">
</property>
So how do I tell Fluent that this is not a Column do not generate the *<column
name="TotalEnrollmentCount" />* part?
if I tell is to to ignore the column via ShouldMap
public override bool ShouldMap(FluentNHibernate.Member member)
{
var attributes = member.MemberInfo.GetCustomAttributes(true);
var isFormular = attributes.Where(o => o is
FormularAttribute).Any();
if (isFormular)
return false;
return base.ShouldMap(member);
}
then nothing got generated...
I am using NH GA 3.0 and Fluent v1.x build
#694<http://fluentnhibernate.org/dls/v1.x/fluentnhibernate-NH3.0-binary-1.2.0.694.zip>
--
You received this message because you are subscribed to the Google Groups
"Fluent NHibernate" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/fluent-nhibernate?hl=en.