Search Results for

    Show / Hide Table of Contents

    Class NpgsqlJsonDbFunctionsExtensions

    Provides methods for supporting translation to PostgreSQL JSON operators and functions.

    Inheritance
    object
    NpgsqlJsonDbFunctionsExtensions
    Namespace: Microsoft.EntityFrameworkCore
    Assembly: Npgsql.EntityFrameworkCore.PostgreSQL.dll
    Syntax
    public static class NpgsqlJsonDbFunctionsExtensions

    Methods

    | Improve this Doc View Source

    JsonContained(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 , a string, or a user POCO mapped to JSON.

    object json

    A JSON column or value. Can be a , a string, or a user POCO mapped to JSON.

    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.

    | Improve this Doc View Source

    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 , a string property mapped to JSON, or a user POCO mapped to JSON.

    object contained

    A JSON column or value. Can be a , a string, or a user POCO mapped to JSON.

    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.

    | Improve this Doc View Source

    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 , a string, or a user POCO mapped to JSON.

    string[] keys

    A set of keys to be checked inside json.

    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.

    | Improve this Doc View Source

    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 , a string, or a user POCO mapped to JSON.

    string[] keys

    A set of keys to be checked inside json.

    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.

    | Improve this Doc View Source

    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 , a string, or a user POCO mapped to JSON.

    string key

    A key to be checked inside json.

    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.

    | Improve this Doc View Source

    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 , a string, or a user POCO mapped to JSON.

    Returns
    Type Description
    string
    Remarks

    See https://www.postgresql.org/docs/current/functions-json.html.

    • Improve this Doc
    • View Source
    In This Article
    Back to top © Copyright 2023 The Npgsql Development Team