Expression<Func<SpecFinderDataModel,bool>>
DoSearch
SpecFinderDataModel
public class SpecFinderDataModel
{
public string ProductID {get; set;}
public string ISBN13 {get; set;}
public string Title {get; set;}
}
// Initial Expression value constant false is the result
Expression<Func<SpecFinderDataModel, bool>> expr = c => false;
// SpecFinderDataModel Object
var sfd = new SpecFinderDataModel
{
ISBN13 = "",
ProductID = "Test A B C",
Title = ""
}
// Call DoSearch and supply the sfd for testing
var result = DoSearch(false,"Test",expr).Compile()(sfd);
// Assert the result in the unit test to understand
Assert.True(result,true);
sfd