I have the following classes:
public abstract class AbstractGeometry : IGeometry
{
// something
}
public class CompositeGeometry : AbstractGeometry
{
IGeometry MainGeometry { get; set; }
IList<IGeometry> Geometries { get; set; }
}
So the CompositeGeometry has a MainGeometry and a list of geometries. Any given geometry may belong to multiple CompositeGeometries.
I have a mapping class for AbstractGeometry and another mapping class for CompositeGeometry.
Now I was wondering: Is it possible to handle the mapping for the list of Geometries in the mapping class of CompositeGeometry?
In the database I already created three tables: AbstractGeometry, CompositeGeometry and CompositeGeometryElements.
The CompositeGeometry table contains a AbstractGeometryId and a MainGeometryId.
The CompositeGeometryElements table contains a CompositeGeometryId and a AbstractGeometryId.