I am trying to dynamically append where conditions into a single expression-object, then pass that expression-object into a method that will use it. However, I keep getting "class name is not available at this point".
Thanks in advance!
UPDATE:
I finally was able to create a working example here.
The Code Look Like:
var view = new vw_QuickFindResult();
// This wont compile
Expression<Func<vw_QuickFindResult, bool>> where = Expression<Func<vw_QuickFindResult, bool>>(view, true);
// Build LIKE Statement
var searches = new List<String>(searchText.Split(' '));
searches.ForEach(productName =>
{
productName.Replace('"', '%');
productName.Replace('*', '%');
where = x => SqlMethods.Like(view.DocumentName, productName);
});
return DocumentCollectionService.ListQuickFind(where);