I am trying to use Nhibernate with the Sql 2008 Geography type and am having difficulty. I am using Fluent Nhibernate to configure which I am fairly new to so that may be th
You can create your own factory with a default SRID. For example, you can create a facade for factories such as this:
public static class Default
{
private const int DefaultSrid = 4326;
public static readonly IGeometryFactory Factory;
static Default()
{
Factory = new GeometryFactory(new PrecisionModel(), DefaultSrid);
}
}
and use it like this:
var point = Default.Factory.CreatePoint(new Coordinate(10, 10));
instead of using the "new" keyword. You can also use the Default.Factory as a factory method in your IoC framework to create new geometries without the Default facade.