System.Linq.Dynamic.Core allows you to execute LINQ queries on an IQueryable using string-based expressions instead of strongly-typed lambda expressions. This is useful for building queries dynamically at runtime. You can use methods like .Where(), .OrderBy(), and .Select() with string arguments. To prevent injection and handle parameters safely, use placeholder syntax like @0, @1, etc., and pass the values as subsequent arguments to the method.
var query = db.Customers
.Where("City == @0 and Orders.Count >= @1", "London", 10)
.OrderBy("CompanyName")
.Select("new(CompanyName as Name, Phone)");