Home
Insert
Update snippet 'F# lambda to C# LINQ Expression'
Title
Description
F# lambda (quotation) to C# Expression<Func<_>> or Expression<Action<_>>
Source code
open Microsoft.FSharp.Linq.RuntimeHelpers open System open System.Linq.Expressions module Lambda = let toExpression (``f# lambda`` : Quotations.Expr<'a>) = ``f# lambda`` |> LeafExpressionConverter.QuotationToExpression |> unbox<Expression<'a>> let test = <@ Func<int, int>(fun i -> i + 5) @> |> Lambda.toExpression
Tags
expression
linq
expression
linq
Author
Link
Reference NuGet packages
If your snippet has external dependencies, enter the names of NuGet packages to reference, separated by a comma (
#r
directives are not required).
Update