I want to dynamically place column name in my select-query. How I can do this?
public IEnumerable MyTable MySelect(string colName, string param) { using (MyEnt
Using dynamic linq:
using System.Linq.Dynamic; public IEnumerable MyTable MySelect(string colName, string param) { using (MyEntities db = new MyEntities ()) { var query = db.MyTable.Where($"{colName} LIKE %{param}%"); return query; } }