Språk

SqlServerDbFunctionsExtensions.JsonContains Method

Definition

A DbFunction method stub that can be used in LINQ queries to target the SQL Server JSON_CONTAINS function.

[System.Diagnostics.CodeAnalysis.Experimental("EF9106")]
public static int JsonContains(this Microsoft.EntityFrameworkCore.DbFunctions _, object json, object searchValue, string? path = default, int? searchMode = default);
[<System.Diagnostics.CodeAnalysis.Experimental("EF9106")>]
static member JsonContains : Microsoft.EntityFrameworkCore.DbFunctions * obj * obj * string * Nullable<int> -> int
<Extension()>
Public Function JsonContains (_ As DbFunctions, json As Object, searchValue As Object, Optional path As String = Nothing, Optional searchMode As Nullable(Of Integer) = Nothing) As Integer

Parameters

_
DbFunctions

The DbFunctions instance.

json
Object

The JSON value to search.

searchValue
Object

The JSON value to search for.

path
String

The JSON path to search within.

searchMode
Nullable<Int32>

The search mode.

Returns

1 if the JSON value contains the given value; otherwise 0.

Attributes

Remarks

See Database functions, and Accessing SQL Server and Azure SQL databases with EF Core for more information and examples.

Applies to