IQueryable or Expression<Func<T, bool>> with Examine to Linq
I am using Linq to Examine, and I am trying to do a dynamic query.
I have the below code
Expression<Func<MyResultClass, bool>> query = x => true;
if (searchField.Any())
{
query.And(x => x.MyField.ContainsAny(searchField));
}
var indexManager = new Index<MyResultClass>(index).Where(query);
But it doesnt work, do you know if Linq To Examine support dynamic querys? Do you know another way to do it? Any issues in my code, Do I coding wrong?
IQueryable or Expression<Func<T, bool>> with Examine to Linq
I am using Linq to Examine, and I am trying to do a dynamic query.
I have the below code
But it doesnt work, do you know if Linq To Examine support dynamic querys? Do you know another way to do it? Any issues in my code, Do I coding wrong?
Thanks
Im sorry for getting back to you late. I will try this out and get back to you. In theory yes it should work. But I will test it out.
What happens if you initialise it with a query?
For some reason my account does not work so I create new one.
I tried to do it with query but I could not, I had a lot of issues. So I am doing raw query directly, without Examine to Linq.
From Umbraco.Examine.Linq I am using only SearchResultMapper
Thanks
Hey
As of 1.1 you can just use multiple where clauses to solve your problem
is working on a reply...