public override InternalRelationshipBuilder Apply(InternalRelationshipBuilder relationshipBuilder, Navigation navigation, OwnedAttribute attribute)
        {
            navigation.SetAnnotation(typeof(OwnedAttribute).FullName, attribute, ConfigurationSource.DataAnnotation);
            relationshipBuilder.DeleteBehavior(DeleteBehavior.Cascade, ConfigurationSource.DataAnnotation);

            return(relationshipBuilder);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     This API supports the Entity Framework Core infrastructure and is not intended to be used
        ///     directly from your code. This API may change or be removed in future releases.
        /// </summary>
        public virtual InternalRelationshipBuilder Apply(InternalRelationshipBuilder relationshipBuilder)
        {
            relationshipBuilder.DeleteBehavior(
                TargetDeleteBehavior(relationshipBuilder.Metadata),
                ConfigurationSource.Convention);

            return(relationshipBuilder);
        }
        public virtual InternalRelationshipBuilder Apply(InternalRelationshipBuilder relationshipBuilder)
        {
            relationshipBuilder.DeleteBehavior(
                relationshipBuilder.Metadata.IsRequired
                    ? DeleteBehavior.Cascade
                    : DeleteBehavior.Restrict,
                ConfigurationSource.Convention);

            return(relationshipBuilder);
        }
        public virtual InternalRelationshipBuilder Apply(InternalRelationshipBuilder relationshipBuilder)
        {
            relationshipBuilder.DeleteBehavior(
                ((IForeignKey)relationshipBuilder.Metadata).IsRequired
                    ? DeleteBehavior.Cascade
                    : DeleteBehavior.Restrict,
                ConfigurationSource.Convention);

            return relationshipBuilder;
        }