criteriaCount.CreateCriteria(AdvertisementsProperties.City.ToString())
.Add(Expression.Like(CitiesProperties.Name.ToString(), query, MatchMode.Anywhere))
.Add(Expression.Like(CitiesProperties.SlovenianName.ToString(), query, MatchMode.Anywhere))
.CreateCriteria(AdvertisementsProperties.Country.ToString())
.Add(Expression.Like(CountriesProperties.Name.ToString(), query, MatchMode.Anywhere))
.Add(Expression.Like(CountriesProperties.SlovenianName.ToString(), query, MatchMode.Anywhere));
This return "name like %foo% and slovenianName like %foo% and name like %foo% and slovenianName like %foo%"
but i would like to get "name like %foo% or slovenianName like %foo% or name like %foo% or slovenianName like %foo%"
i can use Expression.Disjunction() for OR but i have problem that i can not use CreateCriteria inside Expression.Disjunction(). Can someone tell me how can i use OR and CreateCriteria together?
Regards