13

是否可以使用 Fluent Nhibernate 将枚举映射为字符串?

4

2 回答 2

26

是的,如果您这样做,默认情况下会这样做:

Map(x => x.YourProperty);

确保您使用的是最新版本的主干。


正如Yavor Shahpasov在评论中指出的那样,在更新的版本中,您可以通过以下方式完成相同的操作:

Map(x => x.Property).CustomType<GenericEnumMapper<YourPropertyEnumType>>();
于 2009-02-02T14:15:03.210 回答
2

还有可以作为 customType 传递的 EnumString 类

于 2009-09-25T00:19:19.223 回答