Home > Net >  How to use string in select in Entity Framework on .NET 6
How to use string in select in Entity Framework on .NET 6

Time:04-05

I want to make a dynamic query in Entity Framework like this:

var query = db.Select("id, name") 

I try to use System.Linq.Dynamic.Core library also test https://github.com/aaubry/DynamicQuery

but it is not working.

I appreciate any help

CodePudding user response:

Solved by using System.Linq.Dynamic.Core library modify select:

  var query=db.Student.Select("new(Id,Name)").ToDynamicList()
  • Related