Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }