Fixed
Details
Details
Assignee
Ricardo Stuven
Ricardo StuvenReporter
Konstantin Kretov
Konstantin KretovComponents
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created March 24, 2011 at 4:38 AM
Updated December 29, 2011 at 12:41 AM
Resolved December 29, 2011 at 12:41 AM
I have such class:
public class Edge
{
public virtual Guid IDEdge { get; set; }
public virtual Node Source { get; set; }
public virtual Node Target { get; set; }
public virtual double Length { get; set; }
public virtual byte Car { get; set; }
public virtual byte CarReverse { get; set; }
public virtual IGeometry Geometry { get; set; }
}
...and fluent mapping:
public class EdgeMap : ClassMap<Edge>
{
public EdgeMap()
{
Table("Edges");
LazyLoad();
Id(x => x.IDEdge).GeneratedBy.GuidComb().Column("IDEdge");
References(x => x.Source).Column("Source");
References(x => x.Target).Column("Target");
Map(x => x.Length).Not.Nullable().Column("Length");
Map(x => x.Car).Not.Nullable().Column("Car");
Map(x => x.CarReverse).Not.Nullable().Column("CarReverse");
Map(x => x.Geometry).CustomType<MsSql2008GeometryType>().Not.Nullable().Column("Geom");
}
}
I tried to insert edge with geometry:
LINESTRING(5 5, 5 5)
(two points with same coordinates)
I have got:
not-null property references a null or transient value Edge.Geometry
Somewhere instance of Geometry class has been lost. Edge inserts successfully if line contains different points.