Trying to use QueryOver and a flagged enum query. This works in Nhibernate.Linq:
var results = repo.Query()
.Where(x => (x.Classification & LineItemClassification.Shipping) == LineItemClassification.Shipping);
This throws Could not determine member from (Convert(x.Classification) & 2)
using QueryOver:
var results = repo.QueryOver()
.Where(x => (x.Classification & LineItemClassification.Shipping) == LineItemClassification.Shipping);
Any ideas? Suggestions?
Enum:
[Flags]
public enum LineItemClassification
{
Foo,
Widget,
Shipping
}
Mapping:
Map(x => x.Classification)
.CustomType<LineItemClassification>();