I am trying to join aliases multiple times but it depends on the number of 
times it should do it.

Employee employeeAlias = null;Thing thingAlias = null;var names = string[] 
{"A", "B", "C", "D", "E"} // number of values could varyfor(int i = 0; i < 
names.Length ; i++){
   queryOver
       .JoinAlias(() => employeeAlias.Things, 
                  () => thingAlias,
                  JoinType.LeftOuterJoin, 
                  Restrictions.Eq(Projections.Property(() => thingAlias.Name, 
                                  names[i]));}

However, upon execution, NHibernate throws an error saying:

NHibernate.QueryException: duplicate alias: thingAlias ---> 
System.ArgumentException: An item with the same key has already been added

Is there a way I can make NHibernate join an alias with a specified name so 
that it will not re-use the name of the variable?

Thanks guys. This has been my problem since yesterday and I can't find a 
proper solution.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to