private static void AddPostgresNameDictionary(string name, string pgTypeNeeded, NpgsqlDbType npgsqlDbType, params Type[] dotneTypes) { var attr = new TypeMappingAttribute(); attr.PgName = name; attr.NpgsqlDbType = npgsqlDbType; attr.ClrTypes = dotneTypes; attr.PgTypeNeeded = pgTypeNeeded; PostgresNameDictionary.Add(name, attr); }
static PgSqlTypeManager() { PostgresNameDictionary["jsonb"].ClrTypes = new[] { typeof(Dictionary <string, object>) }; AddPostgresNameDictionary("ltree", "text", NpgsqlDbType.Unknown, typeof(PgSqlLTree)); AddPostgresNameDictionary("secstring", null, NpgsqlDbType.Enum, typeof(PgSqlSecureString)); var tma = new TypeMappingAttribute(); tma.NpgsqlDbType = NpgsqlDbType.Enum; tma.ClrTypes = new[] { typeof(Enum) }; tma.PgName = "jsonb"; HandlerTypesByNpsgqlDbType.Add(NpgsqlDbType.Enum, tma); }