-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
> if you are creating expression trees that are evaluated outside the context of the .NET common language runtime, such as in SQL Server, you should not use method calls in lambda expressions. The methods will have no meaning outside the context of the .NET common language runtime.
Depends on whether the specific provider knows how to handle that method call. For example, most providers that output SQL know what to do with the String.StartsWith
method: convert to a LIKE
expression.
Even void
-returning method calls could theoretically be handled by the provider. For example, a call to Console.WriteLine
could be converted to the SQL Server PRINT
statement.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 567260f8-0f94-b48c-8344-0d9780ab4448
- Version Independent ID: 1bebe367-5b93-0b83-72f5-bdf31d65ef5d
- Content: Lambda expressions - C# Programming Guide
- Content Source: docs/csharp/programming-guide/statements-expressions-operators/lambda-expressions.md
- Product: dotnet-csharp
- GitHub Login: @BillWagner
- Microsoft Alias: wiwagn
Metadata
Metadata
Assignees
Labels
Type
Projects
Status