I am struggling to figure out a way to construct query for Find.
basically i would like to have something like
var myquery; //.......... for init query
if (xxxxx)
{
myquery = xxxxx AND YYYYY
}
else
{
myquery = XXXXX
}
mySharpRepo.FindAll(query);
any idea?
in particular, i don't know what data Type should i use for the myquery
how about if i want to chain query together base on condition?
for example:
Expression<Func<User, bool>> query = null;
if (filterByType == true)
{
query = z => z.Type == APPLE
}
if (filterByCountry == True)
{
AND query = z => z.Country == AUSTRALIA
}
So that if filterByCountry and filterByType are both true, the query should become something like
z => z.Type == APPLE && z.Country == AUSTRALIA
and if only filterByCountry is set, then the query should be
z => z.Country == AUSTRALIA
Any thought?
You received this message because you are subscribed to a topic in the Google Groups "SharpRepository" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sharprepository/pGv4A9F8VMU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sharpreposito...@googlegroups.com.
To post to this group, send email to sharpre...@googlegroups.com.
Visit this group at http://groups.google.com/group/sharprepository.
To view this discussion on the web visit https://groups.google.com/d/msgid/sharprepository/96797bd1a7fb4e33b3721f2ee6496b2a%40DM2PR05MB655.namprd05.prod.outlook.com.