Querying DB with conditions on [Flags] enum fields fails

When composing where condition, FlagsAttribute on enum fields isn't taken into account. Condition is built with string representation of enum instead of underlying enum type.