Exemplo n.º 1
0
 internal override void Configure(
     AssociationType associationType,
     AssociationEndMember dependentEnd,
     EntityTypeConfiguration entityTypeConfiguration)
 {
     associationType.MarkIndependent();
 }
        internal override void Configure(
            AssociationType associationType, AssociationEndMember dependentEnd,
            EntityTypeConfiguration entityTypeConfiguration)
        {
            DebugCheck.NotNull(associationType);
            DebugCheck.NotNull(dependentEnd);
            DebugCheck.NotNull(entityTypeConfiguration);

            associationType.MarkIndependent();
        }
        public void Can_mark_association_as_independent()
        {
            var associationType = new AssociationType("A", XmlConstants.ModelNamespace_3, false, DataSpace.CSpace);

            Assert.False(associationType.IsIndependent());

            associationType.MarkIndependent();

            Assert.True(associationType.IsIndependent());
        }
        public void Can_mark_association_as_independent()
        {
            var associationType = new AssociationType();

            Assert.False(associationType.IsIndependent());

            associationType.MarkIndependent();

            Assert.True(associationType.IsIndependent());
        }
        public void Apply_should_not_discover_when_independent_constraint()
        {
            var associationType = new AssociationType("A", XmlConstants.ModelNamespace_3, false, DataSpace.CSpace);

            associationType.SourceEnd = new AssociationEndMember("S", new EntityType("E", "N", DataSpace.CSpace));
            associationType.TargetEnd = new AssociationEndMember("T", new EntityType("E", "N", DataSpace.CSpace));
            associationType.MarkIndependent();

            ((IEdmConvention <AssociationType>) new TypeNameForeignKeyDiscoveryConvention())
            .Apply(associationType, new EdmModel(DataSpace.CSpace));

            Assert.Null(associationType.Constraint);
        }
Exemplo n.º 6
0
        public void Apply_should_not_discover_when_independent_constraint()
        {
            var associationType = new AssociationType();

            associationType.SourceEnd = new AssociationEndMember("S", new EntityType());
            associationType.TargetEnd = new AssociationEndMember("T", new EntityType());
            associationType.MarkIndependent();

            ((IEdmConvention <AssociationType>) new TypeNameForeignKeyDiscoveryConvention())
            .Apply(associationType, new EdmModel().Initialize());

            Assert.Null(associationType.Constraint);
        }