Fluent NHibernate FluentNHibernate.Mapping.Builders Namespace

穿精又带淫゛_ 提交于 2019-12-12 05:58:02

问题


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



来源:https://stackoverflow.com/questions/5621438/fluent-nhibernate-fluentnhibernate-mapping-builders-namespace

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!