Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/EFCore.Abstractions/EFCore.Abstractions.baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,6 @@
"Methods": [
{
"Member": "IndexAttribute(string propertyName, params string[] additionalPropertyNames);"
},
{
"Member": "IndexAttribute(params string[] propertyNames);",
"Stage": "Obsolete"
}
],
"Properties": [
Expand Down
13 changes: 0 additions & 13 deletions src/EFCore.Abstractions/IndexAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,6 @@ public IndexAttribute(string propertyName, params string[] additionalPropertyNam
((List<string>)PropertyNames).AddRange(additionalPropertyNames);
}

/// <summary>
/// Initializes a new instance of the <see cref="IndexAttribute" /> class.
/// </summary>
/// <param name="propertyNames">The properties which constitute the index, in order (there must be at least one).</param>
[Obsolete("Use the other constructor")]
Comment thread
roji marked this conversation as resolved.
public IndexAttribute(params string[] propertyNames)
{
Check.NotEmpty(propertyNames);
Check.HasNoEmptyElements(propertyNames);

PropertyNames = propertyNames.ToList();
}

/// <summary>
/// The properties which constitute the index, in order.
/// </summary>
Expand Down
16 changes: 8 additions & 8 deletions src/EFCore.Cosmos/Diagnostics/CosmosEventId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ private enum Id

// Command events
ExecutingSqlQuery = CoreEventId.ProviderBaseId + 100,
ExecutingReadItem,
ExecutedReadNext,
ExecutedReadItem,
ExecutedCreateItem,
ExecutedReplaceItem,
ExecutedDeleteItem,
ExecutedTransactionalBatch,
ExecutingReadItem = CoreEventId.ProviderBaseId + 101,
Comment thread
AndriySvyryd marked this conversation as resolved.
ExecutedReadNext = CoreEventId.ProviderBaseId + 102,
ExecutedReadItem = CoreEventId.ProviderBaseId + 103,
ExecutedCreateItem = CoreEventId.ProviderBaseId + 104,
ExecutedReplaceItem = CoreEventId.ProviderBaseId + 105,
ExecutedDeleteItem = CoreEventId.ProviderBaseId + 106,
ExecutedTransactionalBatch = CoreEventId.ProviderBaseId + 107,

// Update events
PrimaryKeyValueNotSet = CoreEventId.ProviderBaseId + 200,
BulkExecutionWithTransactionalBatch,
BulkExecutionWithTransactionalBatch = CoreEventId.ProviderBaseId + 201,

// Model validation events
NoPartitionKeyDefined = CoreEventId.ProviderBaseId + 600,
Expand Down
40 changes: 0 additions & 40 deletions src/EFCore.Cosmos/EFCore.Cosmos.baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,6 @@
{
"Member": "static bool CanSetJsonProperty(this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder entityTypeBuilder, string? name, bool fromDataAnnotation = false);"
},
{
"Member": "static bool CanSetPartitionKey(this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder entityTypeBuilder, string? name, bool fromDataAnnotation = false);",
"Stage": "Obsolete"
},
{
"Member": "static bool CanSetPartitionKey(this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder entityTypeBuilder, System.Collections.Generic.IReadOnlyList<string>? names, bool fromDataAnnotation = false);"
},
Expand Down Expand Up @@ -381,10 +377,6 @@
{
"Member": "static Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> HasPartitionKey<TEntity, TProperty>(this Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> entityTypeBuilder, System.Linq.Expressions.Expression<System.Func<TEntity, TProperty>> propertyExpression);"
},
{
"Member": "static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder? HasPartitionKey(this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder entityTypeBuilder, string? name, bool fromDataAnnotation = false);",
"Stage": "Obsolete"
},
{
"Member": "static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder? HasPartitionKey(this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder entityTypeBuilder, System.Collections.Generic.IReadOnlyList<string>? propertyNames, bool fromDataAnnotation = false);"
},
Expand Down Expand Up @@ -510,30 +502,6 @@
{
"Member": "static System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IProperty> GetPartitionKeyProperties(this Microsoft.EntityFrameworkCore.Metadata.IEntityType entityType);"
},
{
"Member": "static Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty? GetPartitionKeyProperty(this Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType entityType);",
"Stage": "Obsolete"
},
{
"Member": "static Microsoft.EntityFrameworkCore.Metadata.IMutableProperty? GetPartitionKeyProperty(this Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType entityType);",
"Stage": "Obsolete"
},
{
"Member": "static Microsoft.EntityFrameworkCore.Metadata.IConventionProperty? GetPartitionKeyProperty(this Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType entityType);",
"Stage": "Obsolete"
},
{
"Member": "static Microsoft.EntityFrameworkCore.Metadata.IProperty? GetPartitionKeyProperty(this Microsoft.EntityFrameworkCore.Metadata.IEntityType entityType);",
"Stage": "Obsolete"
},
{
"Member": "static string? GetPartitionKeyPropertyName(this Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType entityType);",
"Stage": "Obsolete"
},
{
"Member": "static Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource? GetPartitionKeyPropertyNameConfigurationSource(this Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType entityType);",
"Stage": "Obsolete"
},
{
"Member": "static System.Collections.Generic.IReadOnlyList<string> GetPartitionKeyPropertyNames(this Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType entityType);"
},
Expand Down Expand Up @@ -588,14 +556,6 @@
{
"Member": "static bool? SetHasShadowId(this Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType entityType, bool? alwaysCreate, bool fromDataAnnotation = false);"
},
{
"Member": "static void SetPartitionKeyPropertyName(this Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType entityType, string? name);",
"Stage": "Obsolete"
},
{
"Member": "static string? SetPartitionKeyPropertyName(this Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType entityType, string? name, bool fromDataAnnotation = false);",
"Stage": "Obsolete"
},
{
"Member": "static void SetPartitionKeyPropertyNames(this Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType entityType, System.Collections.Generic.IReadOnlyList<string>? names);"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,46 +273,6 @@ public static EntityTypeBuilder<TEntity> HasPartitionKey<TEntity, TProperty>(
return entityTypeBuilder;
}

/// <summary>
/// Configures the property that is used to store the partition key.
/// </summary>
/// <remarks>
/// See <see href="https://aka.ms/efcore-docs-modeling">Modeling entity types and relationships</see>, and
/// <see href="https://aka.ms/efcore-docs-cosmos">Accessing Azure Cosmos DB with EF Core</see> for more information and examples.
/// </remarks>
/// <param name="entityTypeBuilder">The builder for the entity type being configured.</param>
/// <param name="name">The name of the partition key property.</param>
/// <param name="fromDataAnnotation">Indicates whether the configuration was specified using a data annotation.</param>
/// <returns>
/// The same builder instance if the configuration was applied,
/// <see langword="null" /> otherwise.
/// </returns>
[Obsolete("Use HasPartitionKey(IReadOnlyList<string>, bool)")]
Comment thread
roji marked this conversation as resolved.
public static IConventionEntityTypeBuilder? HasPartitionKey(
this IConventionEntityTypeBuilder entityTypeBuilder,
string? name,
bool fromDataAnnotation = false)
=> entityTypeBuilder.HasPartitionKey(name == null ? null : [name], fromDataAnnotation);

/// <summary>
/// Returns a value indicating whether the property that is used to store the partition key can be set
/// from the current configuration source
/// </summary>
/// <remarks>
/// See <see href="https://aka.ms/efcore-docs-modeling">Modeling entity types and relationships</see>, and
/// <see href="https://aka.ms/efcore-docs-cosmos">Accessing Azure Cosmos DB with EF Core</see> for more information and examples.
/// </remarks>
/// <param name="entityTypeBuilder">The builder for the entity type being configured.</param>
/// <param name="name">The name of the partition key property.</param>
/// <param name="fromDataAnnotation">Indicates whether the configuration was specified using a data annotation.</param>
/// <returns><see langword="true" /> if the configuration can be applied.</returns>
[Obsolete("Use HasPartitionKey(IReadOnlyList<string>, bool)")]
public static bool CanSetPartitionKey(
this IConventionEntityTypeBuilder entityTypeBuilder,
string? name,
bool fromDataAnnotation = false)
=> entityTypeBuilder.CanSetPartitionKey(name == null ? null : [name], fromDataAnnotation);

/// <summary>
/// Configures the properties that are used to store the parts of a
/// <see href="https://aka.ms/efcore-cosmos-hpkdocs">hierarchical partition key</see>.
Expand Down
76 changes: 0 additions & 76 deletions src/EFCore.Cosmos/Extensions/CosmosEntityTypeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,82 +118,6 @@ public static void SetContainingPropertyName(this IMutableEntityType entityType,
=> entityType.FindAnnotation(CosmosAnnotationNames.PropertyName)
?.GetConfigurationSource();

/// <summary>
/// Returns the name of the property that is used to store the partition key.
/// </summary>
/// <param name="entityType">The entity type to get the partition key property name for.</param>
/// <returns>The name of the partition key property.</returns>
[Obsolete("Use SetPartitionKeyPropertyNames")]
Comment thread
roji marked this conversation as resolved.
public static string? GetPartitionKeyPropertyName(this IReadOnlyEntityType entityType)
=> entityType.GetPartitionKeyPropertyNames().FirstOrDefault();

/// <summary>
/// Sets the name of the property that is used to store the partition key key.
/// </summary>
/// <param name="entityType">The entity type to set the partition key property name for.</param>
/// <param name="name">The name to set.</param>
[Obsolete("Use SetPartitionKeyPropertyNames")]
public static void SetPartitionKeyPropertyName(this IMutableEntityType entityType, string? name)
=> entityType.SetPartitionKeyPropertyNames(name == null ? null : [name]);

/// <summary>
/// Sets the name of the property that is used to store the partition key.
/// </summary>
/// <param name="entityType">The entity type to set the partition key property name for.</param>
/// <param name="name">The name to set.</param>
/// <param name="fromDataAnnotation">Indicates whether the configuration was specified using a data annotation.</param>
[Obsolete("Use SetPartitionKeyPropertyNames")]
public static string? SetPartitionKeyPropertyName(
this IConventionEntityType entityType,
string? name,
bool fromDataAnnotation = false)
=> entityType.SetPartitionKeyPropertyNames(name is null ? null : [name], fromDataAnnotation)?.FirstOrDefault();

/// <summary>
/// Gets the <see cref="ConfigurationSource" /> for the property that is used to store the partition key.
/// </summary>
/// <param name="entityType">The entity type to find configuration source for.</param>
/// <returns>The <see cref="ConfigurationSource" /> for the partition key property.</returns>
[Obsolete("Use GetPartitionKeyPropertyNamesConfigurationSource")]
public static ConfigurationSource? GetPartitionKeyPropertyNameConfigurationSource(this IConventionEntityType entityType)
=> entityType.GetPartitionKeyPropertyNamesConfigurationSource();

/// <summary>
/// Returns the property that is used to store the partition key.
/// </summary>
/// <param name="entityType">The entity type to get the partition key property for.</param>
/// <returns>The name of the partition key property.</returns>
[Obsolete("Use GetPartitionKeyProperties")]
public static IReadOnlyProperty? GetPartitionKeyProperty(this IReadOnlyEntityType entityType)
=> entityType.GetPartitionKeyProperties().FirstOrDefault();

/// <summary>
/// Returns the property that is used to store the partition key.
/// </summary>
/// <param name="entityType">The entity type to get the partition key property for.</param>
/// <returns>The name of the partition key property.</returns>
[Obsolete("Use GetPartitionKeyProperties")]
public static IMutableProperty? GetPartitionKeyProperty(this IMutableEntityType entityType)
=> entityType.GetPartitionKeyProperties().FirstOrDefault();

/// <summary>
/// Returns the property that is used to store the partition key.
/// </summary>
/// <param name="entityType">The entity type to get the partition key property for.</param>
/// <returns>The name of the partition key property.</returns>
[Obsolete("Use GetPartitionKeyProperties")]
public static IConventionProperty? GetPartitionKeyProperty(this IConventionEntityType entityType)
=> entityType.GetPartitionKeyProperties().FirstOrDefault();

/// <summary>
/// Returns the property that is used to store the partition key.
/// </summary>
/// <param name="entityType">The entity type to get the partition key property for.</param>
/// <returns>The name of the partition key property.</returns>
[Obsolete("Use GetPartitionKeyProperties")]
public static IProperty? GetPartitionKeyProperty(this IEntityType entityType)
=> entityType.GetPartitionKeyProperties().FirstOrDefault();

/// <summary>
/// Returns the names of the properties that are used to store the hierarchical partition key, if any.
/// </summary>
Expand Down
8 changes: 0 additions & 8 deletions src/EFCore.Design/EFCore.Design.baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -587,10 +587,6 @@
{
"Type": "interface Microsoft.EntityFrameworkCore.Scaffolding.IModelCodeGeneratorSelector",
"Methods": [
{
"Member": "Microsoft.EntityFrameworkCore.Scaffolding.IModelCodeGenerator Select(string? language);",
"Stage": "Obsolete"
},
{
"Member": "Microsoft.EntityFrameworkCore.Scaffolding.IModelCodeGenerator Select(Microsoft.EntityFrameworkCore.Scaffolding.ModelCodeGenerationOptions options);"
}
Expand Down Expand Up @@ -784,10 +780,6 @@
"Properties": [
{
"Member": "Microsoft.EntityFrameworkCore.Design.IAnnotationCodeGenerator AnnotationCodeGenerator { get; init; }"
},
{
"Member": "Microsoft.EntityFrameworkCore.Storage.IRelationalTypeMappingSource RelationalTypeMappingSource { get; init; }",
"Stage": "Obsolete"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,11 @@ public sealed record MigrationsCodeGeneratorDependencies
/// </remarks>
[EntityFrameworkInternal]
public MigrationsCodeGeneratorDependencies(
IRelationalTypeMappingSource relationalTypeMappingSource,
IAnnotationCodeGenerator annotationCodeGenerator)
{
#pragma warning disable CS0612 // Type or member is obsolete
RelationalTypeMappingSource = relationalTypeMappingSource;
#pragma warning restore CS0612 // Type or member is obsolete
AnnotationCodeGenerator = annotationCodeGenerator;
}

/// <summary>
/// The type mapper.
/// </summary>
[Obsolete]
Comment thread
roji marked this conversation as resolved.
public IRelationalTypeMappingSource RelationalTypeMappingSource { get; init; }

/// <summary>
/// The annotation code generator.
/// </summary>
Expand Down
13 changes: 1 addition & 12 deletions src/EFCore.Design/Scaffolding/IModelCodeGeneratorSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,10 @@ namespace Microsoft.EntityFrameworkCore.Scaffolding;
/// </remarks>
public interface IModelCodeGeneratorSelector
{
/// <summary>
/// Selects an <see cref="IModelCodeGenerator" /> service for a given programming language.
/// </summary>
/// <param name="language">The programming language.</param>
/// <returns>The <see cref="IModelCodeGenerator" />.</returns>
[Obsolete("Use the overload that takes ModelCodeGenerationOptions instead.")]
Comment thread
roji marked this conversation as resolved.
IModelCodeGenerator Select(string? language);

/// <summary>
/// Selects an <see cref="IModelCodeGenerator" /> service for a given set of options.
/// </summary>
/// <param name="options">The options.</param>
/// <returns>The <see cref="IModelCodeGenerator" />.</returns>
IModelCodeGenerator Select(ModelCodeGenerationOptions options)
#pragma warning disable CS0618 // Type or member is obsolete
=> Select(options.Language);
#pragma warning restore CS0618
IModelCodeGenerator Select(ModelCodeGenerationOptions options);
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,6 @@ public InMemoryValueGeneratorSelector(
: base(dependencies)
=> _inMemoryStore = inMemoryDatabase.Store;

/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
[Obsolete("Use TrySelect and throw if needed when the generator is not found.")]
Comment thread
roji marked this conversation as resolved.
public override ValueGenerator? Select(IProperty property, ITypeBase typeBase)
{
if (TrySelect(property, typeBase, out var valueGenerator))
{
return valueGenerator;
}

throw new NotSupportedException(
CoreStrings.NoValueGenerator(property.Name, property.DeclaringType.DisplayName(), property.ClrType.ShortDisplayName()));
}

/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
Expand Down
11 changes: 1 addition & 10 deletions src/EFCore.Relational/Design/AnnotationCodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ public class AnnotationCodeGenerator : IAnnotationCodeGenerator
RelationalAnnotationNames.UpdateStoredProcedure,
RelationalAnnotationNames.MappingFragments,
RelationalAnnotationNames.RelationalOverrides,
RelationalAnnotationNames.JsonElementMappings,
#pragma warning disable CS0618
RelationalAnnotationNames.ContainerColumnTypeMapping
#pragma warning restore CS0618
RelationalAnnotationNames.JsonElementMappings
};
Comment thread
roji marked this conversation as resolved.

/// <summary>
Expand Down Expand Up @@ -236,9 +233,6 @@ public virtual IReadOnlyList<MethodCallCodeFragment> GenerateFluentApiCalls(
containerColumnName));

annotations.Remove(RelationalAnnotationNames.ContainerColumnName);
#pragma warning disable CS0618
annotations.Remove(RelationalAnnotationNames.ContainerColumnTypeMapping);
#pragma warning restore CS0618
}

if (annotations.TryGetValue(RelationalAnnotationNames.ContainerColumnType, out var containerColumnTypeAnnotation)
Expand Down Expand Up @@ -286,9 +280,6 @@ public virtual IReadOnlyList<MethodCallCodeFragment> GenerateFluentApiCalls(
containerColumnName));

annotations.Remove(RelationalAnnotationNames.ContainerColumnName);
#pragma warning disable CS0618
annotations.Remove(RelationalAnnotationNames.ContainerColumnTypeMapping);
#pragma warning restore CS0618
}

if (annotations.TryGetValue(RelationalAnnotationNames.ContainerColumnType, out var containerColumnTypeAnnotation)
Expand Down
Loading
Loading