/// <summary> /// Configures the foreign key constraint name for this relationship when targeting a relational database. /// </summary> /// <param name="ownershipBuilder"> The builder being used to configure the relationship. </param> /// <param name="name"> The name of the foreign key constraint. </param> /// <returns> The same builder instance so that multiple calls can be chained. </returns> /// <typeparam name="TEntity"> The entity type on one end of the relationship. </typeparam> /// <typeparam name="TDependentEntity"> The entity type on the other end of the relationship. </typeparam> public static OwnershipBuilder <TEntity, TDependentEntity> HasConstraintName <TEntity, TDependentEntity>( [NotNull] this OwnershipBuilder <TEntity, TDependentEntity> ownershipBuilder, [CanBeNull] string name) where TEntity : class where TDependentEntity : class => (OwnershipBuilder <TEntity, TDependentEntity>)HasConstraintName( (OwnershipBuilder)ownershipBuilder, name);
/// <summary> /// Configures the foreign key constraint name for this relationship when targeting a relational database. /// </summary> /// <remarks> /// See <see href="https://aka.ms/efcore-docs-modeling">Modeling entity types and relationships</see> for more information and examples. /// </remarks> /// <param name="ownershipBuilder">The builder being used to configure the relationship.</param> /// <param name="name">The name of the foreign key constraint.</param> /// <returns>The same builder instance so that multiple calls can be chained.</returns> /// <typeparam name="TEntity">The entity type on one end of the relationship.</typeparam> /// <typeparam name="TDependentEntity">The entity type on the other end of the relationship.</typeparam> public static OwnershipBuilder <TEntity, TDependentEntity> HasConstraintName <TEntity, TDependentEntity>( this OwnershipBuilder <TEntity, TDependentEntity> ownershipBuilder, string?name) where TEntity : class where TDependentEntity : class => (OwnershipBuilder <TEntity, TDependentEntity>)HasConstraintName( (OwnershipBuilder)ownershipBuilder, name);
protected OwnershipBuilder( InternalForeignKeyBuilder builder, OwnershipBuilder oldBuilder, bool foreignKeySet = false, bool principalKeySet = false, bool requiredSet = false) : base(builder, oldBuilder, foreignKeySet, principalKeySet, requiredSet) { }
/// <summary> /// Configures the foreign key constraint name for this relationship when targeting a relational database. /// </summary> /// <param name="ownershipBuilder"> The builder being used to configure the relationship. </param> /// <param name="name"> The name of the foreign key constraint. </param> /// <returns> The same builder instance so that multiple calls can be chained. </returns> public static OwnershipBuilder HasConstraintName( [NotNull] this OwnershipBuilder ownershipBuilder, [CanBeNull] string name) { Check.NullButNotEmpty(name, nameof(name)); ownershipBuilder.Metadata.SetConstraintName(name); return(ownershipBuilder); }
/// <summary> /// Configures the foreign key constraint name for this relationship when targeting a relational database. /// </summary> /// <param name="ownershipBuilder"> The builder being used to configure the relationship. </param> /// <param name="name"> The name of the foreign key constraint. </param> /// <returns> The same builder instance so that multiple calls can be chained. </returns> public static OwnershipBuilder HasConstraintName( [NotNull] this OwnershipBuilder ownershipBuilder, [CanBeNull] string name) { Check.NullButNotEmpty(name, nameof(name)); ownershipBuilder.GetInfrastructure <InternalRelationshipBuilder>() .Relational(ConfigurationSource.Explicit) .HasConstraintName(name); return(ownershipBuilder); }
protected virtual NonGenericTestOwnershipBuilder <TNewEntity, TNewRelatedEntity> Wrap <TNewEntity, TNewRelatedEntity>( OwnershipBuilder ownershipBuilder) where TNewEntity : class where TNewRelatedEntity : class => new NonGenericTestOwnershipBuilder <TNewEntity, TNewRelatedEntity>(ownershipBuilder);
public NonGenericTestOwnershipBuilder(OwnershipBuilder ownershipBuilder) { OwnershipBuilder = ownershipBuilder; }
protected virtual GenericTestOwnershipBuilder <TNewEntity, TNewDependentEntity> Wrap <TNewEntity, TNewDependentEntity>( OwnershipBuilder <TNewEntity, TNewDependentEntity> ownershipBuilder) where TNewEntity : class where TNewDependentEntity : class => new GenericTestOwnershipBuilder <TNewEntity, TNewDependentEntity>(ownershipBuilder);
public GenericTestOwnershipBuilder(OwnershipBuilder <TEntity, TDependentEntity> ownershipBuilder) { OwnershipBuilder = ownershipBuilder; }