Fluent NHibernate FluentNHibernate.Mapping.Builder

2019-09-11 01:51发布

问题:

I am using the latest version of Fluent NHibernate (1.2.0.712) retrieved over NuGet. Previously I have used the FluentNHibernate.Mapping.Builders Namespace to create mapping extensions similar to:

 public static class MappingExtensions
{
    public static PropertyBuilder Text(this PropertyBuilder propertyBuilder)
    {
        propertyBuilder.Length(10000);
        return propertyBuilder;
    }

    public static PropertyBuilder Money(this PropertyBuilder propertyBuilder)
    {
        propertyBuilder.CustomType<MoneyUserType>();
        return propertyBuilder;
    }
}

which could be used as such:

Map(x => x.Price).Money();

I know get the error:

Error   1   The type or namespace name 'Builders' does not exist in the namespace 'FluentNHibernate.Mapping' (are you missing an assembly reference?)   

I am referencing the correct assembly. In Reflector and Object Browser I can't find the above namespace but in the source code from GitHub it's there.

Am I missing something obvious?

回答1:

This namespace has been moved and some of the functionality has been renamed/modified. This post on google groups may or may not help you with this.

http://groups.google.com/group/fluent-nhibernate/browse_thread/thread/5e751b7d49fbf770