DocumentQueryable.CreateUserDefinedFunctionQuery Method

 

Namespace:   Microsoft.Azure.Documents.Linq
Assembly:  Microsoft.Azure.Documents.Client (in Microsoft.Azure.Documents.Client.dll)

Overload List

Name Description
System_CAPS_pubmethodSystem_CAPS_static CreateUserDefinedFunctionQuery(DocumentClient, String, FeedOptions)

Overloaded. This method creates create a query for udfs under a collection. It returns An IOrderedQueryable{UserDefinedFunction>.

System_CAPS_pubmethodSystem_CAPS_static CreateUserDefinedFunctionQuery(DocumentClient, String, SqlQuerySpec, FeedOptions)

Overloaded. This method creates create a query for udfs under a collection with parameterized values. It returns an IQueryable{dynamic}. For more information on preparing SQL statements with parameterized values, please see SqlQuerySpec.

System_CAPS_pubmethodSystem_CAPS_static CreateUserDefinedFunctionQuery(DocumentClient, String, String, FeedOptions)

Overloaded. This method creates create a query for udfs under a collection using a SQL statement. It returns an IQueryable{dynamic}.

See Also

DocumentQueryable Class
Microsoft.Azure.Documents.Linq Namespace

Return to top

DocumentQueryable.CreateUserDefinedFunctionQuery Method (DocumentClient, String, FeedOptions)

Overloaded. This method creates create a query for udfs under a collection. It returns An IOrderedQueryable{UserDefinedFunction>.

Syntax

public static IOrderedQueryable<UserDefinedFunction> CreateUserDefinedFunctionQuery(
    this DocumentClient client,
    string userDefinedFunctionsLink,
    FeedOptions feedOptions = null
)
public:
[ExtensionAttribute]
static IOrderedQueryable<UserDefinedFunction^>^ CreateUserDefinedFunctionQuery(
    DocumentClient^ client,
    String^ userDefinedFunctionsLink,
    FeedOptions^ feedOptions = null
)
<ExtensionAttribute>
Public Shared Function CreateUserDefinedFunctionQuery (
    client As DocumentClient,
    userDefinedFunctionsLink As String,
    feedOptions As FeedOptions
) As IOrderedQueryable(Of UserDefinedFunction)

Parameters

  • userDefinedFunctionsLink
    Type: System.String

    The path link for udfs unders a collection, e.g. dbs/db_rid/colls/coll_rid/udfs/.

Return Value

Type: System.Linq.IOrderedQueryable<UserDefinedFunction>

An IOrderedQueryable{UserDefinedFunction} that can evaluate the query with the provided SQL statement.

Examples

This example below queries for user-defined functions by id.

UserDefinedFunction udf = client.CreateUserDefinedFunctionQuery(collectionLink).Where(u => u.Id == "sqrt").AsEnumerable().FirstOrDefault();

See Also

UserDefinedFunction
IDocumentQuery

Return to top

DocumentQueryable.CreateUserDefinedFunctionQuery Method (DocumentClient, String, SqlQuerySpec, FeedOptions)

Overloaded. This method creates create a query for udfs under a collection with parameterized values. It returns an IQueryable{dynamic}. For more information on preparing SQL statements with parameterized values, please see SqlQuerySpec.

Syntax

public static IQueryable<object> CreateUserDefinedFunctionQuery(
    this DocumentClient client,
    string userDefinedFunctionsLink,
    SqlQuerySpec querySpec,
    FeedOptions feedOptions = null
)
public:
[ExtensionAttribute]
static IQueryable<Object^>^ CreateUserDefinedFunctionQuery(
    DocumentClient^ client,
    String^ userDefinedFunctionsLink,
    SqlQuerySpec^ querySpec,
    FeedOptions^ feedOptions = null
)
<ExtensionAttribute>
Public Shared Function CreateUserDefinedFunctionQuery (
    client As DocumentClient,
    userDefinedFunctionsLink As String,
    querySpec As SqlQuerySpec,
    feedOptions As FeedOptions
) As IQueryable(Of Object)

Parameters

  • userDefinedFunctionsLink
    Type: System.String

    The path link for udfs unders a collection, e.g. dbs/db_rid/colls/coll_rid/udfs/.

Return Value

Type: System.Linq.IQueryable<Object>

An IQueryable{dynamic} that can evaluate the query with the provided SQL statement.

Remarks

Refer to https://msdn.microsoft.com/en-us/library/azure/dn782250.aspx and https://azure.microsoft.com/documentation/articles/documentdb-sql-query/ for syntax and examples.

Examples

This example below queries for user-defined functions by id.

var query = new SqlQuerySpec("SELECT * FROM udfs u WHERE u.id = @id", new SqlParameterCollection(new SqlParameter[] { new SqlParameter { Name = "@id", Value = "sqrt" }}));
UserDefinedFunction udf = client.CreateUserDefinedFunctionQuery(collectionLink, query).AsEnumerable().FirstOrDefault();

See Also

UserDefinedFunction
IDocumentQuery

Return to top

DocumentQueryable.CreateUserDefinedFunctionQuery Method (DocumentClient, String, String, FeedOptions)

Overloaded. This method creates create a query for udfs under a collection using a SQL statement. It returns an IQueryable{dynamic}.

Syntax

public static IQueryable<object> CreateUserDefinedFunctionQuery(
    this DocumentClient client,
    string userDefinedFunctionsLink,
    string sqlExpression,
    FeedOptions feedOptions = null
)
public:
[ExtensionAttribute]
static IQueryable<Object^>^ CreateUserDefinedFunctionQuery(
    DocumentClient^ client,
    String^ userDefinedFunctionsLink,
    String^ sqlExpression,
    FeedOptions^ feedOptions = null
)
<ExtensionAttribute>
Public Shared Function CreateUserDefinedFunctionQuery (
    client As DocumentClient,
    userDefinedFunctionsLink As String,
    sqlExpression As String,
    feedOptions As FeedOptions
) As IQueryable(Of Object)

Parameters

  • userDefinedFunctionsLink
    Type: System.String

    The path link for udfs unders a collection, e.g. dbs/db_rid/colls/coll_rid/udfs/.

Return Value

Type: System.Linq.IQueryable<Object>

An IQueryable{dynamic} that can evaluate the query with the provided SQL statement.

Remarks

Refer to https://msdn.microsoft.com/en-us/library/azure/dn782250.aspx and https://azure.microsoft.com/documentation/articles/documentdb-sql-query/ for syntax and examples.

Examples

This example below queries for user-defined functions by id.

UserDefinedFunction udf = client.CreateUserDefinedFunctionQuery(collectionLink, "SELECT * FROM udfs u WHERE u.id = 'sqrt'").AsEnumerable().FirstOrDefault();

See Also

UserDefinedFunction
IDocumentQuery

Return to top