Search Results for

    Show / Hide Table of Contents

    Class NpgsqlJsonNetExtensions

    Extension allowing adding the Json.NET plugin to an Npgsql type mapper.

    Inheritance
    Object
    NpgsqlJsonNetExtensions
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: Npgsql
    Assembly: Npgsql.Json.NET.dll
    Syntax
    public static class NpgsqlJsonNetExtensions

    Methods

    UseJsonNet(INpgsqlTypeMapper, Type[], Type[], Nullable<JsonSerializerSettings>)

    Sets up JSON.NET mappings for the PostgreSQL json and jsonb types.

    Declaration
    public static INpgsqlTypeMapper UseJsonNet(this INpgsqlTypeMapper mapper, Type[] jsonbClrTypes = null, Type[] jsonClrTypes = null, JsonSerializerSettings? settings = null)
    Parameters
    Type Name Description
    INpgsqlTypeMapper mapper

    The type mapper to set up (global or connection-specific)

    Type[] jsonbClrTypes

    A list of CLR types to map to PostgreSQL jsonb (no need to specify NpgsqlDbType.Jsonb)

    Type[] jsonClrTypes

    A list of CLR types to map to PostgreSQL json (no need to specify NpgsqlDbType.Json)

    Nullable<JsonSerializerSettings> settings

    Optional settings to customize JSON serialization

    Returns
    Type Description
    INpgsqlTypeMapper
    In This Article
    Back to top © Copyright 2022 The Npgsql Development Team