"cannot use subqueries on a criteria without a projection". This is
the error message I am getting. Is there an alternate way of
accomplishing this? I am OK to not us LINQ.
public Questionnaire Get(string countryCode, string languageCode)
{
using (ISession session =
NHibernateHelper.OpenSession())
using (ITransaction transaction =
session.BeginTransaction())
{
try
{
return
session.Linq<Questionnaire>()
.Where(x =>
x.CountryCode == countryCode &&
x.LanguageCode
== languageCode &&
x.EffectiveDate < DateTime.Now &&
x.ExpirationDate > DateTime.Now)
.Where(x =>
x.Sections == x.Sections.Where(s => s.Section.LanguageCode ==
languageCode)).ToList()
.FirstOrDefault();
}
finally
{
transaction.Commit();
}
}
}
--
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.