Exemple #1
0
        public void Setup()
        {
            mappingSet = new MappingSetImpl(new Database("DB1"), new EntitySetImpl());

            entity1 = new EntityImpl("Entity1");
            entity2 = new EntityImpl("Entity2");
            mappingSet.EntitySet.AddEntity(entity1);
            mappingSet.EntitySet.AddEntity(entity2);

            reference1 = entity1.CreateReferenceTo(entity2);
            var reference2 = entity1.CreateReferenceTo(entity2);

            refMapping1 = new TableReferenceMappingImpl {
                FromTable = new Table("Table2"), ToReference = reference2
            };
            var refMapping2 = new TableReferenceMappingImpl {
                FromTable = new Table("Table1"), ToReference = reference1
            };

            relMapping1 = new RelationshipReferenceMappingImpl {
                FromRelationship = new RelationshipImpl(), ToReference = reference2
            };
            var relMapping2 = new RelationshipReferenceMappingImpl {
                FromRelationship = new RelationshipImpl(), ToReference = reference1
            };

            mappingSet.AddMapping(refMapping1);
            mappingSet.AddMapping(refMapping2);

            mappingSet.AddMapping(relMapping1);
            mappingSet.AddMapping(relMapping2);
        }
Exemple #2
0
        public static TableReferenceMapping GetMapping()
        {
            TableReferenceMapping mapping = new TableReferenceMappingImpl();

            mapping.FromTable   = new Table("Table1");
            mapping.ToReference = new ReferenceImpl(new Guid("11111111-1111-1111-1111-111111111111"));
            mapping.MappingSet  = new MappingSetImpl();

            return(mapping);
        }