Class NpgsqlJsonDbFunctionsExtensions
Provides methods for supporting translation to PostgreSQL JSON operators and functions.
Namespace: Microsoft.EntityFrameworkCore
Assembly: Npgsql.EntityFrameworkCore.PostgreSQL.dll
Syntax
public static class NpgsqlJsonDbFunctionsExtensions
Methods
| Improve this Doc View SourceJsonContained(DbFunctions, object, object)
Checks if contained
is contained in json
as top-level entries.
Declaration
public static bool JsonContained(this DbFunctions _, object contained, object json)
Parameters
Type | Name | Description |
---|---|---|
DbFunctions | _ | DbFunctions instance |
object | contained | A JSON column or value. Can be a |
object | json | A JSON column or value. Can be a |
Returns
Type | Description |
---|---|
bool |
Remarks
This operation is only supported with PostgreSQL jsonb
, not json
.
See https://www.postgresql.org/docs/current/functions-json.html.
JsonContains(DbFunctions, object, object)
Checks if json
contains contained
as top-level entries.
Declaration
public static bool JsonContains(this DbFunctions _, object json, object contained)
Parameters
Type | Name | Description |
---|---|---|
DbFunctions | _ | DbFunctions instance |
object | json | A JSON column or value. Can be a |
object | contained | A JSON column or value. Can be a |
Returns
Type | Description |
---|---|
bool |
Remarks
This operation is only supported with PostgreSQL jsonb
, not json
.
See https://www.postgresql.org/docs/current/functions-json.html.
JsonExistAll(DbFunctions, object, params string[])
Checks if all of the given keys
exist as top-level keys within json
.
Declaration
public static bool JsonExistAll(this DbFunctions _, object json, params string[] keys)
Parameters
Type | Name | Description |
---|---|---|
DbFunctions | _ | DbFunctions instance |
object | json | A JSON column or value. Can be a |
string[] | keys | A set of keys to be checked inside |
Returns
Type | Description |
---|---|
bool |
Remarks
This operation is only supported with PostgreSQL jsonb
, not json
.
See https://www.postgresql.org/docs/current/functions-json.html.
JsonExistAny(DbFunctions, object, params string[])
Checks if any of the given keys
exist as top-level keys within json
.
Declaration
public static bool JsonExistAny(this DbFunctions _, object json, params string[] keys)
Parameters
Type | Name | Description |
---|---|---|
DbFunctions | _ | DbFunctions instance |
object | json | A JSON column or value. Can be a |
string[] | keys | A set of keys to be checked inside |
Returns
Type | Description |
---|---|
bool |
Remarks
This operation is only supported with PostgreSQL jsonb
, not json
.
See https://www.postgresql.org/docs/current/functions-json.html.
JsonExists(DbFunctions, object, string)
Checks if key
exists as a top-level key within json
.
Declaration
public static bool JsonExists(this DbFunctions _, object json, string key)
Parameters
Type | Name | Description |
---|---|---|
DbFunctions | _ | DbFunctions instance |
object | json | A JSON column or value. Can be a |
string | key | A key to be checked inside |
Returns
Type | Description |
---|---|
bool |
Remarks
This operation is only supported with PostgreSQL jsonb
, not json
.
See https://www.postgresql.org/docs/current/functions-json.html.
JsonTypeof(DbFunctions, object)
Returns the type of the outermost JSON value as a text string. Possible types are object, array, string, number, boolean, and null.
Declaration
public static string JsonTypeof(this DbFunctions _, object json)
Parameters
Type | Name | Description |
---|---|---|
DbFunctions | _ | DbFunctions instance |
object | json | A JSON column or value. Can be a |
Returns
Type | Description |
---|---|
string |