Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

entity framework dynamic search solution 1

var filters = new List<Expression<Func<Application, bool>>>();

if (!string.IsNullOrWhitespace(searchObj.CUST_NAME_X))
    filters.Add(application => application .CUST_NAME_X.Contains(searchObj.CUST_NAME_X.Trim());

if (!string.IsNullOrEmpty(searchObj.SURNM_X))
    filters.Add(application => application .CUST_SURNM_X.Contains(searchObj.SURNM_X.Trim());

// And so on for all criteria
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #entity #framework #dynamic #search #solution
ADD COMMENT
Topic
Name
8+2 =