问题确实说明了一切,默认情况下它映射为string
但我需要它映射为int
.
我目前正在使用PersistenceModel
如果这有什么区别的话,我可以设定我的惯例。
Update发现从主干获取最新版本的代码解决了我的困境。
定义这个约定的方式以前有时会改变,现在是:
public class EnumConvention : IUserTypeConvention
{
public void Accept(IAcceptanceCriteria<IPropertyInspector> criteria)
{
criteria.Expect(x => x.Property.PropertyType.IsEnum);
}
public void Apply(IPropertyInstance target)
{
target.CustomType(target.Property.PropertyType);
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)