protected override void Populate( ConventionModelMapper mapper ) { base.Populate(mapper); mapper.AddMapping <CommonDomainObjects.Mapping.TemporalObject <char> >(); mapper.AddMapping <CommonDomainObjects.Mapping.TemporalObjectVersion <char> >(); mapper.Class <TestObject>( customizeAction => customizeAction.Table(typeof(TestObject).Name)); mapper.Subclass <TemporalTestObject>( customizeAction => customizeAction.List( temporalObject => temporalObject.Versions, collectionMapper => { collectionMapper.Key(keyMapper => keyMapper.Column("TemporalObjectId")); collectionMapper.Index( listIndexMapper => { listIndexMapper.Column("Number"); listIndexMapper.Base(1); }); })); mapper.Class <TestObjectVersion>(customizeAction => customizeAction.Table(typeof(TestObjectVersion).Name)); }
void MapDirectionalRelationship(ConventionModelMapper mapper) { mapper.Subclass <DirectionalRelationship>(map => { map.DiscriminatorValue(RelationshipType.Directional); map.Property(x => x.SecondarySummary, p => { p.NotNullable(false); }); }); }
void MapNonDirectionalRelationship(ConventionModelMapper mapper) { mapper.Subclass <NonDirectionalRelationship>(map => { map.DiscriminatorValue(RelationshipType.NonDirectional); }); }