I have some flags like this:
Code:
[Flags]
enum MyEnum
{
Nothing = 0,
Foo = 1,
Bar = 2,
Fuzz = 4
}
These flags map to several columns, FLAG_FOO, FLAG_BAR and FLAG_FUZZ.
As my database doesn't support booleans, those columns are of type nullable char(1) with 'X' meaning "true" and null meaning "false". I have implemented IUserType ("CharBooleanType") for such columns when used alone.
How can I have those three columns as one bit vector and still be able to use the columns in the WHERE part of the query?
Like "where Flag.Foo is not null" or something.
My current implementation implements IUserType, so getting the flags converted to an instance of MyEnum is not a problem, I only struggle with querying the columns.
I have read that implementing ICompositeUserType instead will do the job.
But what will I have to do for my implementation to support those "char booleans?"
What should
PropertyTypes return?
Why are both
Get/SetPropertyValue and
NullSafeGet/Set methods required?
What should
IsMutable return?
Unfortunately I could hardly find any information online, so any help will be highly appreciated.
/Marvin