Dynamic column name in where clause. Entity Framework

后端 未结 4 1793
遥遥无期
遥遥无期 2021-01-23 01:06

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         


        
4条回答
  •  深忆病人
    2021-01-23 01:55

    Have a look at the Dynamic Linq library and ScottGu's how to library here - it allows for dynamic filtering, sorting etc.

提交回复
热议问题