Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Dynamic Linq Filters - Linq

$
0
0

Hi,

How can I pass the Searchingname flexible into this commands:-

I have params as searchingName [ eg: Output: Description ] & searchingValue.

namePredicate = (character => searchingName .StartsWith(searchingValue, StringComparison.OrdinalIgnoreCase)); << Not working

This is hardcoded fieldname

namePredicate = (character => character.Description.StartsWith(searchingValue, StringComparison.OrdinalIgnoreCase)); <<Working

May I know how to do it without hardcoded the fieldname; I would like to passed in the fieldname into Linq statement.

Please advise.

Thanks

Regards,

Micheale


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>