Skip to content

Commit

Permalink
Remove obsolete builder extension APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
roji committed Feb 2, 2020
1 parent 84051cf commit 8d1723c
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 624 deletions.
142 changes: 0 additions & 142 deletions src/EFCore.PG/Extensions/NpgsqlEntityTypeBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,147 +253,5 @@ public static EntityTypeBuilder<TEntity> UseCockroachDbInterleaveInParent<TEntit
=> (EntityTypeBuilder<TEntity>)UseCockroachDbInterleaveInParent((EntityTypeBuilder)entityTypeBuilder, parentTableType, interleavePrefix);

#endregion CockroachDB Interleave-in-parent

#region Obsolete


/// <summary>
/// Configures a comment to be applied on the table.
/// </summary>
/// <param name="entityTypeBuilder">The builder for the entity type being configured.</param>
/// <param name="comment">The comment for the table.</param>
/// <returns>The same builder instance so that multiple calls can be chained.</returns>
[Obsolete("Use HasComment")]
public static EntityTypeBuilder ForNpgsqlHasComment(
[NotNull] this EntityTypeBuilder entityTypeBuilder,
[CanBeNull] string comment)
{
Check.NotNull(entityTypeBuilder, nameof(entityTypeBuilder));
Check.NullButNotEmpty(comment, nameof(comment));

entityTypeBuilder.HasComment(comment);

return entityTypeBuilder;
}

/// <summary>
/// Configures a comment to be applied on the table.
/// </summary>
/// <typeparam name="TEntity">The entity type being configured.</typeparam>
/// <param name="entityTypeBuilder">The builder for the entity type being configured.</param>
/// <param name="comment">The comment for the table.</param>
/// <returns>The same builder instance so that multiple calls can be chained.</returns>
[Obsolete("Use HasComment")]
public static EntityTypeBuilder<TEntity> ForNpgsqlHasComment<TEntity>(
[NotNull] this EntityTypeBuilder<TEntity> entityTypeBuilder,
[CanBeNull] string comment)
where TEntity : class
=> (EntityTypeBuilder<TEntity>)ForNpgsqlHasComment((EntityTypeBuilder)entityTypeBuilder, comment);

/// <summary>
/// Configures using the auto-updating system column <c>xmin</c> as the optimistic concurrency token.
/// </summary>
/// <remarks>
/// See http://www.npgsql.org/efcore/miscellaneous.html#optimistic-concurrency-and-concurrency-tokens
/// </remarks>
/// <param name="entityTypeBuilder">The builder for the entity type being configured.</param>
/// <returns>The same builder instance so that multiple calls can be chained.</returns>
[Obsolete("Use UseXminAsConcurrencyToken")]
public static EntityTypeBuilder ForNpgsqlUseXminAsConcurrencyToken([NotNull] this EntityTypeBuilder entityTypeBuilder)
=> entityTypeBuilder.UseXminAsConcurrencyToken();

/// <summary>
/// Configures using the auto-updating system column <c>xmin</c> as the optimistic concurrency token.
/// </summary>
/// <remarks>
/// See http://www.npgsql.org/efcore/miscellaneous.html#optimistic-concurrency-and-concurrency-tokens
/// </remarks>
/// <param name="entityTypeBuilder">The builder for the entity type being configured.</param>
/// <returns>The same builder instance so that multiple calls can be chained.</returns>
[Obsolete("Use UseXminAsConcurrencyToken")]
public static EntityTypeBuilder<TEntity> ForNpgsqlUseXminAsConcurrencyToken<TEntity>([NotNull] this EntityTypeBuilder<TEntity> entityTypeBuilder)
where TEntity : class
=> entityTypeBuilder.UseXminAsConcurrencyToken();

/// <summary>
/// Sets a PostgreSQL storage parameter on the table created for this entity.
/// </summary>
/// <remarks>
/// See https://www.postgresql.org/docs/current/static/sql-createtable.html#SQL-CREATETABLE-STORAGE-PARAMETERS
/// </remarks>
/// <param name="entityTypeBuilder"> The builder for the entity type being configured. </param>
/// <param name="parameterName"> The name of the storage parameter. </param>
/// <param name="parameterValue"> The value of the storage parameter. </param>
/// <returns> The same builder instance so that multiple calls can be chained. </returns>
[Obsolete("Use SetStorageParameter")]
public static EntityTypeBuilder ForNpgsqlSetStorageParameter(
[NotNull] this EntityTypeBuilder entityTypeBuilder, string parameterName, object parameterValue)
=> entityTypeBuilder.SetStorageParameter(parameterName, parameterValue);

/// <summary>
/// Sets a PostgreSQL storage parameter on the table created for this entity.
/// </summary>
/// <remarks>
/// See https://www.postgresql.org/docs/current/static/sql-createtable.html#SQL-CREATETABLE-STORAGE-PARAMETERS
/// </remarks>
/// <param name="entityTypeBuilder"> The builder for the entity type being configured. </param>
/// <param name="parameterName"> The name of the storage parameter. </param>
/// <param name="parameterValue"> The value of the storage parameter. </param>
/// <returns> The same builder instance so that multiple calls can be chained. </returns>
[Obsolete("Use SetStorageParameter")]
public static EntityTypeBuilder<TEntity> ForNpgsqlSetStorageParameter<TEntity>(
[NotNull] this EntityTypeBuilder<TEntity> entityTypeBuilder, string parameterName, object parameterValue)
where TEntity : class
=> entityTypeBuilder.SetStorageParameter(parameterName, parameterValue);

/// <summary>
/// Configures the entity to use an unlogged table when targeting Npgsql.
/// </summary>
/// <param name="entityTypeBuilder">The builder for the entity type being configured.</param>
/// <param name="isUnlogged">True to configure the entity to use an unlogged table; otherwise, false.</param>
/// <returns>
/// The same builder instance so that multiple calls can be chained.
/// </returns>
/// <remarks>
/// See: https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-UNLOGGED
/// </remarks>
[Obsolete("Use IsUnlogged")]
public static EntityTypeBuilder ForNpgsqlIsUnlogged([NotNull] this EntityTypeBuilder entityTypeBuilder, bool isUnlogged = true)
=> entityTypeBuilder.IsUnlogged(isUnlogged);

/// <summary>
/// Configures the mapped table to use an unlogged table when targeting Npgsql.
/// </summary>
/// <param name="entityTypeBuilder">The builder for the entity type being configured.</param>
/// <param name="isUnlogged">True to configure the entity to use an unlogged table; otherwise, false.</param>
/// <returns>
/// The same builder instance so that multiple calls can be chained.
/// </returns>
/// <remarks>
/// See: https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-UNLOGGED
/// </remarks>
[Obsolete("Use IsUnlogged")]
public static EntityTypeBuilder<TEntity> ForNpgsqlIsUnlogged<TEntity>(
[NotNull] this EntityTypeBuilder<TEntity> entityTypeBuilder,
bool isUnlogged = true)
where TEntity : class
=> entityTypeBuilder.IsUnlogged(isUnlogged);

[Obsolete("Use UseCockroachDbInterleaveInParent")]
public static EntityTypeBuilder ForCockroachDbInterleaveInParent(
[NotNull] this EntityTypeBuilder entityTypeBuilder,
[NotNull] Type parentTableType,
[NotNull] List<string> interleavePrefix)
=> entityTypeBuilder.UseCockroachDbInterleaveInParent(parentTableType, interleavePrefix);

[Obsolete("Use UseCockroachDbInterleaveInParent")]
public static EntityTypeBuilder<TEntity> ForCockroachDbInterleaveInParent<TEntity>(
[NotNull] this EntityTypeBuilder<TEntity> entityTypeBuilder,
[NotNull] Type parentTableType,
[NotNull] List<string> interleavePrefix)
where TEntity : class
=> entityTypeBuilder.UseCockroachDbInterleaveInParent(parentTableType, interleavePrefix);

#endregion Obsolete
}
}
106 changes: 0 additions & 106 deletions src/EFCore.PG/Extensions/NpgsqlIndexBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -635,111 +635,5 @@ public static bool CanSetIsCreatedConcurrently(
}

#endregion Created concurrently

#region Obsolete

/// <summary>
/// The PostgreSQL index method to be used. Null selects the default (currently btree).
/// </summary>
/// <remarks>
/// http://www.postgresql.org/docs/current/static/sql-createindex.html
/// </remarks>
/// <param name="indexBuilder">The builder for the index being configured.</param>
/// <param name="method">The name of the index.</param>
/// <returns>A builder to further configure the index.</returns>
[Obsolete("Use HasMethod")]
public static IndexBuilder ForNpgsqlHasMethod([NotNull] this IndexBuilder indexBuilder, [CanBeNull] string method)
=> indexBuilder.HasMethod(method);

/// <summary>
/// The PostgreSQL index operators to be used.
/// </summary>
/// <remarks>
/// https://www.postgresql.org/docs/current/static/indexes-opclass.html
/// </remarks>
/// <param name="indexBuilder">The builder for the index being configured.</param>
/// <param name="operators">The operators to use for each column.</param>
/// <returns>A builder to further configure the index.</returns>
[Obsolete("Use HasOperators")]
public static IndexBuilder ForNpgsqlHasOperators([NotNull] this IndexBuilder indexBuilder, [CanBeNull, ItemNotNull] params string[] operators)
=> indexBuilder.HasOperators(operators);

/// <summary>
/// The PostgreSQL index collation to be used.
/// </summary>
/// <remarks>
/// https://www.postgresql.org/docs/current/static/indexes-collations.html
/// </remarks>
/// <param name="indexBuilder">The builder for the index being configured.</param>
/// <param name="values">The sort options to use for each column.</param>
/// <returns>A builder to further configure the index.</returns>
[Obsolete("Use HasCollation")]
public static IndexBuilder ForNpgsqlHasCollation([NotNull] this IndexBuilder indexBuilder, [CanBeNull, ItemNotNull] params string[] values)
=> indexBuilder.HasCollation(values);

/// <summary>
/// The PostgreSQL index sort ordering to be used.
/// </summary>
/// <remarks>
/// https://www.postgresql.org/docs/current/static/indexes-ordering.html
/// </remarks>
/// <param name="indexBuilder">The builder for the index being configured.</param>
/// <param name="values">The sort order to use for each column.</param>
/// <returns>A builder to further configure the index.</returns>
[Obsolete("Use HasSortOrder")]
public static IndexBuilder ForNpgsqlHasSortOrder([NotNull] this IndexBuilder indexBuilder, [CanBeNull] params SortOrder[] values)
=> indexBuilder.HasSortOrder(values);

/// <summary>
/// The PostgreSQL index NULL sort ordering to be used.
/// </summary>
/// <remarks>
/// https://www.postgresql.org/docs/current/static/indexes-ordering.html
/// </remarks>
/// <param name="indexBuilder">The builder for the index being configured.</param>
/// <param name="values">The sort order to use for each column.</param>
/// <returns>A builder to further configure the index.</returns>
[Obsolete("Use HasNullSortOrder")]
public static IndexBuilder ForNpgsqlHasNullSortOrder([NotNull] this IndexBuilder indexBuilder, [CanBeNull] params NullSortOrder[] values)
=> indexBuilder.HasNullSortOrder(values);

/// <summary>
/// Adds an INCLUDE clause to the index definition with the specified property names.
/// This clause specifies a list of columns which will be included as a non-key part in the index.
/// </summary>
/// <remarks>
/// https://www.postgresql.org/docs/current/sql-createindex.html
/// </remarks>
/// <param name="indexBuilder">The builder for the index being configured.</param>
/// <param name="propertyNames">An array of property names to be used in INCLUDE clause.</param>
/// <returns>A builder to further configure the index.</returns>
[Obsolete("Use IncludeProperties")]
public static IndexBuilder ForNpgsqlInclude([NotNull] this IndexBuilder indexBuilder, [NotNull, ItemNotNull] params string[] propertyNames)
=> indexBuilder.IncludeProperties(propertyNames);

/// <summary>
/// Adds an INCLUDE clause to the index definition with property names from the specified expression.
/// This clause specifies a list of columns which will be included as a non-key part in the index.
/// </summary>
/// <remarks>
/// https://www.postgresql.org/docs/current/sql-createindex.html
/// </remarks>
/// <param name="indexBuilder">The builder for the index being configured.</param>
/// <param name="includeExpression">
/// <para>
/// A lambda expression representing the property(s) to be included in the INCLUDE clause
/// (<c>blog => blog.Url</c>).
/// </para>
/// <para>
/// If multiple properties are to be included then specify an anonymous type including the
/// properties (<c>post => new { post.Title, post.BlogId }</c>).
/// </para>
/// </param>
/// <returns>A builder to further configure the index.</returns>
[Obsolete("Use IncludeProperties")]
public static IndexBuilder<TEntity> ForNpgsqlInclude<TEntity>([NotNull] this IndexBuilder<TEntity> indexBuilder, [NotNull] Expression<Func<TEntity, object>> includeExpression)
=> indexBuilder.IncludeProperties(includeExpression);

#endregion Obsolete
}
}
Loading

0 comments on commit 8d1723c

Please sign in to comment.