Hi all,

Lets say I have this movie application where I store movies which can
have a many-to-many relation with genres. The movie object have a bag
with genres, and the genre have a bag of movies.

Lets say I store a movie "Rambo" with genre "Action" and another movie
"Beverly Hills Cop" with genres "Action" and "Comedy".

I have this method that will return any movie in the string[]
searchWords = new List[] {"Action", "Comedy"} :
            return m_session
                .CreateCriteria(typeof(Movie))
                .CreateCriteria("Genres")
                .Add(Expression.In("Genre", searchWords))
                .List();

This acually gives back a list with
{"Rambo", "Rambo", "Beverly Hills Cop", "Beverly Hills Cop", "Beverly
Hills Cop"}

Why is that? If I run the generated SQL query I get {"Rambo", "Beverly
Hills Cop", "Beverly Hills Cop"} as expected. That's question one...

Question two: Is it possible to modify the method above to return only
movies that matches all the genres in the searchWords?

Regards,

Jonas.

--~--~---------~--~----~------------~-------~--~----~
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