Skip to content

Commit 3f584ca

Browse files
authored
Remove old obsoleted APIs (#3350)
1 parent ff8513a commit 3f584ca

File tree

10 files changed

+0
-690
lines changed

10 files changed

+0
-690
lines changed

src/EFCore.PG/Design/Internal/NpgsqlAnnotationCodeGenerator.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,6 @@ private static readonly MethodInfo IndexHasOperatorsMethodInfo
105105
= typeof(NpgsqlIndexBuilderExtensions).GetRequiredRuntimeMethod(
106106
nameof(NpgsqlIndexBuilderExtensions.HasOperators), typeof(IndexBuilder), typeof(string[]));
107107

108-
private static readonly MethodInfo IndexHasSortOrderMethodInfo
109-
= typeof(NpgsqlIndexBuilderExtensions).GetRequiredRuntimeMethod(
110-
nameof(NpgsqlIndexBuilderExtensions.HasSortOrder), typeof(IndexBuilder), typeof(SortOrder[]));
111-
112108
private static readonly MethodInfo IndexHasNullSortOrderMethodInfo
113109
= typeof(NpgsqlIndexBuilderExtensions).GetRequiredRuntimeMethod(
114110
nameof(NpgsqlIndexBuilderExtensions.HasNullSortOrder), typeof(IndexBuilder), typeof(NullSortOrder[]));
@@ -423,8 +419,6 @@ public override IReadOnlyList<MethodCallCodeFragment> GenerateFluentApiCalls(
423419
=> new MethodCallCodeFragment(IndexHasMethodMethodInfo, annotation.Value),
424420
NpgsqlAnnotationNames.IndexOperators
425421
=> new MethodCallCodeFragment(IndexHasOperatorsMethodInfo, annotation.Value),
426-
NpgsqlAnnotationNames.IndexSortOrder
427-
=> new MethodCallCodeFragment(IndexHasSortOrderMethodInfo, annotation.Value),
428422
NpgsqlAnnotationNames.IndexNullSortOrder
429423
=> new MethodCallCodeFragment(IndexHasNullSortOrderMethodInfo, annotation.Value),
430424
NpgsqlAnnotationNames.IndexInclude

src/EFCore.PG/Extensions/BuilderExtensions/NpgsqlEntityTypeBuilderExtensions.cs

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -294,45 +294,4 @@ public static EntityTypeBuilder<TEntity> UseCockroachDbInterleaveInParent<TEntit
294294
(EntityTypeBuilder)entityTypeBuilder, parentTableType, interleavePrefix);
295295

296296
#endregion CockroachDB Interleave-in-parent
297-
298-
#region Obsolete
299-
300-
/// <summary>
301-
/// Configures using the auto-updating system column <c>xmin</c> as the optimistic concurrency token.
302-
/// </summary>
303-
/// <param name="entityTypeBuilder">The builder for the entity type being configured.</param>
304-
/// <returns>The same builder instance so that multiple calls can be chained.</returns>
305-
/// <remarks>
306-
/// See <see href="https://www.npgsql.org/efcore/modeling/concurrency.html">Concurrency tokens</see>
307-
/// for more information on using optimistic concurrency in PostgreSQL.
308-
/// </remarks>
309-
[Obsolete("Use EF Core's standard IsRowVersion() or [Timestamp], see https://learn.microsoft.com/ef/core/saving/concurrency")]
310-
public static EntityTypeBuilder UseXminAsConcurrencyToken(
311-
this EntityTypeBuilder entityTypeBuilder)
312-
{
313-
Check.NotNull(entityTypeBuilder, nameof(entityTypeBuilder));
314-
315-
entityTypeBuilder.Property<uint>("xmin")
316-
.HasColumnType("xid")
317-
.ValueGeneratedOnAddOrUpdate()
318-
.IsConcurrencyToken();
319-
320-
return entityTypeBuilder;
321-
}
322-
323-
/// <summary>
324-
/// Configures using the auto-updating system column <c>xmin</c> as the optimistic concurrency token.
325-
/// </summary>
326-
/// <remarks>
327-
/// See http://www.npgsql.org/efcore/miscellaneous.html#optimistic-concurrency-and-concurrency-tokens
328-
/// </remarks>
329-
/// <param name="entityTypeBuilder">The builder for the entity type being configured.</param>
330-
/// <returns>The same builder instance so that multiple calls can be chained.</returns>
331-
[Obsolete("Use EF Core's standard IsRowVersion() or [Timestamp], see https://learn.microsoft.com/ef/core/saving/concurrency")]
332-
public static EntityTypeBuilder<TEntity> UseXminAsConcurrencyToken<TEntity>(
333-
this EntityTypeBuilder<TEntity> entityTypeBuilder)
334-
where TEntity : class
335-
=> (EntityTypeBuilder<TEntity>)UseXminAsConcurrencyToken((EntityTypeBuilder)entityTypeBuilder);
336-
337-
#endregion Obsolete
338297
}

src/EFCore.PG/Extensions/BuilderExtensions/NpgsqlIndexBuilderExtensions.cs

Lines changed: 0 additions & 277 deletions
Original file line numberDiff line numberDiff line change
@@ -847,281 +847,4 @@ public static bool CanSetStorageParameter(
847847
}
848848

849849
#endregion Storage parameters
850-
851-
#region Sort order (legacy)
852-
853-
/// <summary>
854-
/// The PostgreSQL index sort ordering to be used.
855-
/// </summary>
856-
/// <remarks>
857-
/// https://www.postgresql.org/docs/current/static/indexes-ordering.html
858-
/// </remarks>
859-
/// <param name="indexBuilder">The builder for the index being configured.</param>
860-
/// <param name="values">The sort order to use for each column.</param>
861-
/// <returns>A builder to further configure the index.</returns>
862-
[Obsolete("Use IsDescending instead")]
863-
public static IndexBuilder HasSortOrder(
864-
this IndexBuilder indexBuilder,
865-
params SortOrder[]? values)
866-
{
867-
Check.NotNull(indexBuilder, nameof(indexBuilder));
868-
Check.NullButNotEmpty(values, nameof(values));
869-
870-
var isDescending = new bool[indexBuilder.Metadata.Properties.Count];
871-
872-
for (var i = 0; i < isDescending.Length; i++)
873-
{
874-
isDescending[i] = values?.Length > i && values[i] == SortOrder.Descending;
875-
}
876-
877-
indexBuilder.IsDescending(isDescending);
878-
879-
return indexBuilder;
880-
}
881-
882-
/// <summary>
883-
/// The PostgreSQL index sort ordering to be used.
884-
/// </summary>
885-
/// <remarks>
886-
/// https://www.postgresql.org/docs/current/static/indexes-ordering.html
887-
/// </remarks>
888-
/// <param name="indexBuilder">The builder for the index being configured.</param>
889-
/// <param name="values">The sort order to use for each column.</param>
890-
/// <returns>A builder to further configure the index.</returns>
891-
[Obsolete("Use IsDescending instead")]
892-
public static IndexBuilder<TEntity> HasSortOrder<TEntity>(
893-
this IndexBuilder<TEntity> indexBuilder,
894-
params SortOrder[]? values)
895-
=> (IndexBuilder<TEntity>)HasSortOrder((IndexBuilder)indexBuilder, values);
896-
897-
/// <summary>
898-
/// The PostgreSQL index sort ordering to be used.
899-
/// </summary>
900-
/// <remarks>
901-
/// https://www.postgresql.org/docs/current/static/indexes-ordering.html
902-
/// </remarks>
903-
/// <param name="indexBuilder">The builder for the index being configured.</param>
904-
/// <param name="fromDataAnnotation">Indicates whether the configuration was specified using a data annotation.</param>
905-
/// <param name="values">The sort order to use for each column.</param>
906-
/// <returns>A builder to further configure the index.</returns>
907-
[Obsolete("Use IsDescending instead")]
908-
public static IConventionIndexBuilder? HasSortOrder(
909-
this IConventionIndexBuilder indexBuilder,
910-
IReadOnlyList<SortOrder>? values,
911-
bool fromDataAnnotation)
912-
{
913-
if (indexBuilder.CanSetSortOrder(values, fromDataAnnotation))
914-
{
915-
Check.NotNull(indexBuilder, nameof(indexBuilder));
916-
Check.NullButNotEmpty(values, nameof(values));
917-
918-
var isDescending = new bool[indexBuilder.Metadata.Properties.Count];
919-
920-
for (var i = 0; i < isDescending.Length; i++)
921-
{
922-
isDescending[i] = values?.Count > i && values[i] == SortOrder.Descending;
923-
}
924-
925-
indexBuilder.IsDescending(isDescending);
926-
927-
return indexBuilder;
928-
}
929-
930-
return null;
931-
}
932-
933-
/// <summary>
934-
/// Returns a value indicating whether the PostgreSQL index sort ordering can be set.
935-
/// </summary>
936-
/// <remarks>
937-
/// https://www.postgresql.org/docs/current/static/indexes-ordering.html
938-
/// </remarks>
939-
/// <param name="indexBuilder">The builder for the index being configured.</param>
940-
/// <param name="values">The sort order to use for each column.</param>
941-
/// <param name="fromDataAnnotation">Indicates whether the configuration was specified using a data annotation.</param>
942-
/// <returns>A builder to further configure the index.</returns>
943-
[Obsolete("Use IsDescending instead")]
944-
public static bool CanSetSortOrder(
945-
this IConventionIndexBuilder indexBuilder,
946-
IReadOnlyList<SortOrder>? values,
947-
bool fromDataAnnotation)
948-
{
949-
Check.NotNull(indexBuilder, nameof(indexBuilder));
950-
951-
return indexBuilder.CanSetAnnotation(NpgsqlAnnotationNames.IndexSortOrder, values, fromDataAnnotation);
952-
}
953-
954-
#endregion Sort order (obsolete)
955-
956-
#region Obsolete
957-
958-
/// <summary>
959-
/// The PostgreSQL index collation to be used.
960-
/// </summary>
961-
/// <remarks>
962-
/// https://www.postgresql.org/docs/current/static/indexes-collations.html
963-
/// </remarks>
964-
/// <param name="indexBuilder">The builder for the index being configured.</param>
965-
/// <param name="values">The sort options to use for each column.</param>
966-
/// <returns>A builder to further configure the index.</returns>
967-
[Obsolete("Use UseCollation")]
968-
public static IndexBuilder HasCollation(
969-
this IndexBuilder indexBuilder,
970-
params string[]? values)
971-
=> UseCollation(indexBuilder, values);
972-
973-
/// <summary>
974-
/// The PostgreSQL index collation to be used.
975-
/// </summary>
976-
/// <remarks>
977-
/// https://www.postgresql.org/docs/current/static/indexes-collations.html
978-
/// </remarks>
979-
/// <param name="indexBuilder">The builder for the index being configured.</param>
980-
/// <param name="values">The sort options to use for each column.</param>
981-
/// <returns>A builder to further configure the index.</returns>
982-
[Obsolete("Use UseCollation")]
983-
public static IndexBuilder<TEntity> HasCollation<TEntity>(
984-
this IndexBuilder<TEntity> indexBuilder,
985-
params string[]? values)
986-
=> UseCollation(indexBuilder, values);
987-
988-
/// <summary>
989-
/// The PostgreSQL index collation to be used.
990-
/// </summary>
991-
/// <remarks>
992-
/// https://www.postgresql.org/docs/current/static/indexes-collations.html
993-
/// </remarks>
994-
/// <param name="indexBuilder">The builder for the index being configured.</param>
995-
/// <param name="values">The sort options to use for each column.</param>
996-
/// <param name="fromDataAnnotation">Indicates whether the configuration was specified using a data annotation.</param>
997-
/// <returns>A builder to further configure the index.</returns>
998-
[Obsolete("Use UseCollation")]
999-
public static IConventionIndexBuilder? HasCollation(
1000-
this IConventionIndexBuilder indexBuilder,
1001-
IReadOnlyList<string>? values,
1002-
bool fromDataAnnotation)
1003-
=> UseCollation(indexBuilder, values, fromDataAnnotation);
1004-
1005-
/// <summary>
1006-
/// Returns a value indicating whether the PostgreSQL index collation can be set.
1007-
/// </summary>
1008-
/// <remarks>
1009-
/// https://www.postgresql.org/docs/current/static/indexes-collations.html
1010-
/// </remarks>
1011-
/// <param name="indexBuilder">The builder for the index being configured.</param>
1012-
/// <param name="values">The sort options to use for each column.</param>
1013-
/// <param name="fromDataAnnotation">Indicates whether the configuration was specified using a data annotation.</param>
1014-
/// <returns>A builder to further configure the index.</returns>
1015-
[Obsolete("Use CanSetHasCollation")]
1016-
public static bool CanSetHasCollation(
1017-
this IConventionIndexBuilder indexBuilder,
1018-
IReadOnlyList<string>? values,
1019-
bool fromDataAnnotation)
1020-
=> CanSetCollation(indexBuilder, values, fromDataAnnotation);
1021-
1022-
/// <summary>
1023-
/// The PostgreSQL index method to be used. Null selects the default (currently btree).
1024-
/// </summary>
1025-
/// <remarks>
1026-
/// http://www.postgresql.org/docs/current/static/sql-createindex.html
1027-
/// </remarks>
1028-
/// <param name="indexBuilder">The builder for the index being configured.</param>
1029-
/// <param name="method">The name of the index.</param>
1030-
/// <param name="fromDataAnnotation">Indicates whether the configuration was specified using a data annotation.</param>
1031-
/// <returns><c>true</c> if the index can be configured with the method</returns>
1032-
[Obsolete("Use CanSetMethod")]
1033-
public static bool CanSetHasMethod(
1034-
this IConventionIndexBuilder indexBuilder,
1035-
string? method,
1036-
bool fromDataAnnotation = false)
1037-
=> CanSetMethod(indexBuilder, method, fromDataAnnotation);
1038-
1039-
/// <summary>
1040-
/// Returns a value indicating whether the PostgreSQL index operators can be set.
1041-
/// </summary>
1042-
/// <remarks>
1043-
/// https://www.postgresql.org/docs/current/static/indexes-opclass.html
1044-
/// </remarks>
1045-
/// <param name="indexBuilder">The builder for the index being configured.</param>
1046-
/// <param name="operators">The operators to use for each column.</param>
1047-
/// <param name="fromDataAnnotation">Indicates whether the configuration was specified using a data annotation.</param>
1048-
/// <returns><c>true</c> if the index can be configured with the method.</returns>
1049-
[Obsolete("Use CanSetOperators")]
1050-
public static bool CanSetHasOperators(
1051-
this IConventionIndexBuilder indexBuilder,
1052-
IReadOnlyList<string>? operators,
1053-
bool fromDataAnnotation)
1054-
=> CanSetOperators(indexBuilder, operators, fromDataAnnotation);
1055-
1056-
/// <summary>
1057-
/// Returns a value indicating whether the index can be configured as a full-text tsvector expression index.
1058-
/// </summary>
1059-
/// <param name="indexBuilder">The builder for the index being configured.</param>
1060-
/// <param name="config">
1061-
/// <para>
1062-
/// The text search configuration for this generated tsvector property, or <c>null</c> if this is not a
1063-
/// generated tsvector property.
1064-
/// </para>
1065-
/// <para>
1066-
/// See https://www.postgresql.org/docs/current/textsearch-controls.html for more information.
1067-
/// </para>
1068-
/// </param>
1069-
/// <param name="fromDataAnnotation">Indicates whether the configuration was specified using a data annotation.</param>
1070-
/// <returns><c>true</c> if the index can be configured as a full-text tsvector expression index.</returns>
1071-
[Obsolete("Use CanSetIsTsVectorExpressionIndex")]
1072-
public static bool CanSetToTsVector(
1073-
this IConventionIndexBuilder indexBuilder,
1074-
string? config,
1075-
bool fromDataAnnotation = false)
1076-
=> CanSetIsTsVectorExpressionIndex(indexBuilder, config, fromDataAnnotation);
1077-
1078-
/// <summary>
1079-
/// Returns a value indicating whether the PostgreSQL index sort ordering can be set.
1080-
/// </summary>
1081-
/// <remarks>
1082-
/// https://www.postgresql.org/docs/current/static/indexes-ordering.html
1083-
/// </remarks>
1084-
/// <param name="indexBuilder">The builder for the index being configured.</param>
1085-
/// <param name="values">The sort order to use for each column.</param>
1086-
/// <param name="fromDataAnnotation">Indicates whether the configuration was specified using a data annotation.</param>
1087-
/// <returns>A builder to further configure the index.</returns>
1088-
[Obsolete("Use CanSetSortOrder")]
1089-
public static bool CanSetHasSortOrder(
1090-
this IConventionIndexBuilder indexBuilder,
1091-
IReadOnlyList<SortOrder>? values,
1092-
bool fromDataAnnotation)
1093-
=> CanSetSortOrder(indexBuilder, values, fromDataAnnotation);
1094-
1095-
/// <summary>
1096-
/// Returns a value indicating whether the PostgreSQL index null sort ordering can be set.
1097-
/// </summary>
1098-
/// <remarks>
1099-
/// https://www.postgresql.org/docs/current/static/indexes-ordering.html
1100-
/// </remarks>
1101-
/// <param name="indexBuilder">The builder for the index being configured.</param>
1102-
/// <param name="values">The sort order to use for each column.</param>
1103-
/// <param name="fromDataAnnotation">Indicates whether the configuration was specified using a data annotation.</param>
1104-
/// <returns>A builder to further configure the index.</returns>
1105-
[Obsolete("Use CanSetNullSortOrder")]
1106-
public static bool CanSetHasNullSortOrder(
1107-
this IConventionIndexBuilder indexBuilder,
1108-
IReadOnlyList<NullSortOrder>? values,
1109-
bool fromDataAnnotation)
1110-
=> CanSetNullSortOrder(indexBuilder, values, fromDataAnnotation);
1111-
1112-
/// <summary>
1113-
/// Returns a value indicating whether the given include properties can be set.
1114-
/// </summary>
1115-
/// <param name="indexBuilder">The builder for the index being configured.</param>
1116-
/// <param name="propertyNames">An array of property names to be used in 'include' clause.</param>
1117-
/// <param name="fromDataAnnotation">Indicates whether the configuration was specified using a data annotation.</param>
1118-
/// <returns> <c>true</c> if the given include properties can be set. </returns>
1119-
[Obsolete("Use CanSetIncludeProperties")]
1120-
public static bool CanSetInclude(
1121-
this IConventionIndexBuilder indexBuilder,
1122-
IReadOnlyList<string>? propertyNames,
1123-
bool fromDataAnnotation = false)
1124-
=> CanSetIncludeProperties(indexBuilder, propertyNames, fromDataAnnotation);
1125-
1126-
#endregion Obsolete
1127850
}

0 commit comments

Comments
 (0)