Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用了约定:
store.Conventions.SaveEnumsAsIntegers = true;
枚举现在被正确地保存为整数,但是,当我尝试使用枚举进行查询时,查询会在其字符串表示形式中使用枚举进行翻译,这不会给我任何结果。
session.Query<Entity>().Where(x => x.EnumProp == MyEnum.Value1);
我的印象是 SaveEnumsAsIntegers 在持久化和查询时根据这篇文章进行转换:
查询作为整数持久存在的枚举属性不起作用
任何人都可以帮忙吗?
我已经针对 RavenDB 2330 进行了测试,它按预期工作。
在此处查看通过的单元测试。
如果您有不同的做法,请更新您的问题。谢谢。