DocumentServiceQueryable.AsSQL<TSource, TResult> Method (IOrderedQueryable<TSource>, Expression<Func<String>>)
Creates and returns a SQL query.
Namespace: Microsoft.Azure.Documents.Linq
Assembly: Microsoft.Azure.Documents.Client (in Microsoft.Azure.Documents.Client.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Function AsSQL(Of TSource, TResult) ( _
source As IOrderedQueryable(Of TSource), _
sqlExpression As Expression(Of Func(Of String)) _
) As IQueryable(Of TResult)
'Usage
Dim source As IOrderedQueryable(Of TSource)
Dim sqlExpression As Expression(Of Func(Of String))
Dim returnValue As IQueryable(Of TResult)
returnValue = source.AsSQL(sqlExpression)
public static IQueryable<TResult> AsSQL<TSource, TResult>(
this IOrderedQueryable<TSource> source,
Expression<Func<string>> sqlExpression
)
[ExtensionAttribute]
public:
generic<typename TSource, typename TResult>
static IQueryable<TResult>^ AsSQL(
IOrderedQueryable<TSource>^ source,
Expression<Func<String^>^>^ sqlExpression
)
static member AsSQL :
source:IOrderedQueryable<'TSource> *
sqlExpression:Expression<Func<string>> -> IQueryable<'TResult>
JScript does not support generic types and methods.
Type Parameters
- TSource
The source type.
- TResult
The result type.
Parameters
- source
Type: System.Linq.IOrderedQueryable<TSource>
The source result set.
- sqlExpression
Type: System.Linq.Expressions.Expression<Func<String>>
The SQL query language expression.
Return Value
Type: System.Linq.IQueryable<TResult>
The query result set.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IOrderedQueryable<TSource>. When you use instance method syntax to call this method, omit the first parameter. For more information, see https://msdn.microsoft.com/en-us/library/bb384936(v=azure.100) or https://msdn.microsoft.com/en-us/library/bb383977(v=azure.100).
Remarks
Refer to the DocumentDB SQL query documentation for syntax and examples.