Skip to content

Commit

Permalink
More changes from API review (#31324)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriySvyryd committed Jul 21, 2023
1 parent 6534e63 commit 5274ba3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Microsoft.EntityFrameworkCore;
/// <remarks>
/// See <see href="https://aka.ms/efcore-docs-database-functions">Database functions</see> for more information and examples.
/// </remarks>
public static class RelationalDbFunctionExtensions
public static class RelationalDbFunctionsExtensions
{
/// <summary>
/// Explicitly specifies a collation to be used in a LINQ query. Can be used to generate fragments such as
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.Relational/Query/Internal/CollateTranslator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Microsoft.EntityFrameworkCore.Query.Internal;
public class CollateTranslator : IMethodCallTranslator
{
private static readonly MethodInfo MethodInfo
= typeof(RelationalDbFunctionExtensions).GetMethod(nameof(RelationalDbFunctionExtensions.Collate))!;
= typeof(RelationalDbFunctionsExtensions).GetMethod(nameof(RelationalDbFunctionsExtensions.Collate))!;

/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public override bool IsEvaluatableExpression(Expression expression, IModel model
return false;
}

if (method.DeclaringType == typeof(RelationalDbFunctionExtensions))
if (method.DeclaringType == typeof(RelationalDbFunctionsExtensions))
{
return false;
}
Expand Down
12 changes: 12 additions & 0 deletions src/EFCore/Infrastructure/AnnotatableBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,18 @@ private static bool CanSetAnnotationValue(
|| canOverrideSameSource);
}

/// <summary>
/// Removes any annotation with the given name.
/// </summary>
/// <param name="name">The name of the annotation to remove.</param>
/// <param name="configurationSource">The configuration source of the annotation to be set.</param>
/// <returns>The same builder so that multiple calls can be chained.</returns>
[Obsolete("Use HasNoAnnotation instead")]
public virtual AnnotatableBuilder<TMetadata, TModelBuilder>? RemoveAnnotation(
string name,
ConfigurationSource configurationSource)
=> HasNoAnnotation(name, configurationSource);

/// <summary>
/// Removes any annotation with the given name.
/// </summary>
Expand Down
6 changes: 3 additions & 3 deletions test/EFCore.Relational.Tests/RelationalApiConsistencyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,9 @@ public class RelationalApiConsistencyFixture : ApiConsistencyFixtureBase
{
typeof(IReadOnlyDbFunction),
(
typeof(RelationalDbFunctionExtensions),
typeof(RelationalDbFunctionExtensions),
typeof(RelationalDbFunctionExtensions),
typeof(RelationalDbFunctionsExtensions),
typeof(RelationalDbFunctionsExtensions),
typeof(RelationalDbFunctionsExtensions),
null,
null
)
Expand Down

0 comments on commit 5274ba3

Please sign in to comment.