Beispiel #1
0
            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));
            }
Beispiel #2
0
        void MapDirectionalRelationship(ConventionModelMapper mapper)
        {
            mapper.Subclass <DirectionalRelationship>(map => {
                map.DiscriminatorValue(RelationshipType.Directional);

                map.Property(x => x.SecondarySummary, p => {
                    p.NotNullable(false);
                });
            });
        }
Beispiel #3
0
 void MapNonDirectionalRelationship(ConventionModelMapper mapper)
 {
     mapper.Subclass <NonDirectionalRelationship>(map => {
         map.DiscriminatorValue(RelationshipType.NonDirectional);
     });
 }