Use Power Fx inside of LINQ.
This project translates Power Fx formulas into .NET Expression trees enabling you to use them inside of LINQ queries.
The latest prerelease version is available on MyGet.
dotnet add package Bricelam.PowerFx.Linq --source https://www.myget.org/F/bricelam/api/v3/index.jsonThe PowerFxExpression class allows you to create lambda expressions from formulas.
// TIP: Hardcoded formulas aren't very interesting, but imagine if they're
// defined outside the code!
var formula = "Radius = 1";
var predicate = PowerFxExpression.Predicate<Circle>(formula);
var query = circles.Where(predicate);The PowerFxQueryable class provides queryable extension methods that use formulas.
var query = circles
.AddColumns(
("Diameter", "2 * Radius"),
("Circumference", "2 * Pi() * Radius")
("Area", "Pi() * Radius^2"));