criteria - newbie Nhibernate join query in a DetachedCriteria -


i have domain this:

class project { ... unit projectunit }  class unit { ... ilist<user> users }  class user { ... 

}

i have projects based on 1 user, so: each project unit.users contain query user.

how can translate detachedcriteria?

this assumes have id property on user class , you're passing in user user.

detachedcriteria query = detachedcriteria.for(typeof(project),"project")                             .createcriteria("projectunit","unit")                             .createcriteria("users","users")                             .add(expression.eq("id", user.id)); 

Comments

Popular posts from this blog

silverlight - Applying a style to ItemContainerStyle in C# -

c# - NullReferenceException in MySqlClient.NativeDriver -

php - Updating recent updates - Problem in procedure - Any other approach? -