Hi,

I've defined an enum like this:

namespace Test
{
        [System.FlagsAttribute]
        public enum ETest
        {
                Test1 = 1,
                Test2 = 2,
                Test3 = 4
        }

        public class ETestStringType : NHibernate.Type.EnumStringType<ETest>
        {
        }
}

In my hbm file file I use it in a property:

<property name="TestEnum1"
               type="Test.ETestStringType, Test"
               not-null="true" />

I can set the property with myObject.TestEnum1 = ETest.Test1 |
ETest.Test2.

I use LINQ to quere the data:

var result = from obj in session.Linq<MyType> where obj.TestEnum1 ==
ETest.Test1 select obj;

This returns all objects with TestEnum1 set to "ETest.Test1" but not
objects with TestEnum1 set to e.g. "ETest.Test1 | ETest.Test3"

I need a way to get all objects set to ETest.Test1 combined with any
other flag.

Any ideas?

Thanks
Olaf

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to