EF: how declare a colum with type 'ltree'

39 views
Skip to first unread message

clz....@gmail.com

unread,
May 14, 2015, 10:31:07 AM5/14/15
to npgsq...@googlegroups.com
hi, i'm trying to create a database with ef code first.
my problem is that i have this class

public class Node
{
public Node()
{
}

public long Id
{
get;
set;
}

public string Path
{
get;
set;
}
}

and i want to map the Path property to a column with ltree type.
i'm using this code in dbcontext.onmodelcreating

modelBuilder.RegisterEntityType(typeof(Node));
modelBuilder.Entity<Node>().Property(x => x.Path).HasColumnType("ltree");


but i got an exception that seems to be thrown becouse theallowed types are only the PrimitiveTypes defined in NpgsqlProviderManifest.Manifest.xml

is it possible to create a column with a custom type as ltree?
if no can i extend NpgsqlProviderManifest.Manifest.xml with ltree modules type and send it to github?

thanks
Reply all
Reply to author
Forward
0 new messages