Skip to content

Commit 101f7a5

Browse files
committed
Revert changes from #1887, which changed extension method invocation in same class
1 parent 4acd5fb commit 101f7a5

File tree

6 files changed

+9
-8
lines changed

6 files changed

+9
-8
lines changed

JsonApiDotNetCore.slnx.DotSettings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EventNeverSubscribedTo_002ELocal/@EntryIndexedValue">WARNING</s:String>
5252
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ExtractCommonPropertyPattern/@EntryIndexedValue">SUGGESTION</s:String>
5353
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=IntroduceOptionalParameters_002EGlobal/@EntryIndexedValue">HINT</s:String>
54+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=InvokeAsExtensionMemberFromSameClass/@EntryIndexedValue">DO_NOT_SHOW</s:String>
5455
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=LambdaExpressionMustBeStatic/@EntryIndexedValue">WARNING</s:String>
5556
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=LocalFunctionCanBeMadeStatic/@EntryIndexedValue">SUGGESTION</s:String>
5657
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=LocalizableElement/@EntryIndexedValue">DO_NOT_SHOW</s:String>

src/JsonApiDotNetCore.Annotations/TypeExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ internal static class TypeExtensions
77
/// </summary>
88
public static bool IsOrImplementsInterface<TInterface>(this Type? source)
99
{
10-
return source.IsOrImplementsInterface(typeof(TInterface));
10+
return IsOrImplementsInterface(source, typeof(TInterface));
1111
}
1212

1313
/// <summary>

src/JsonApiDotNetCore/Configuration/ServiceCollectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static IServiceCollection AddJsonApi<TDbContext>(this IServiceCollection
2121
Action<ServiceDiscoveryFacade>? discovery = null, Action<ResourceGraphBuilder>? resources = null, IMvcCoreBuilder? mvcBuilder = null)
2222
where TDbContext : DbContext
2323
{
24-
return services.AddJsonApi(options, discovery, resources, mvcBuilder, [typeof(TDbContext)]);
24+
return AddJsonApi(services, options, discovery, resources, mvcBuilder, [typeof(TDbContext)]);
2525
}
2626

2727
/// <summary>

test/TestBuildingBlocks/DbContextExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ public static void AddInRange(this DbContext dbContext, params object[] entities
1313
public static async Task ClearTableAsync<TEntity>(this DbContext dbContext)
1414
where TEntity : class
1515
{
16-
await dbContext.ClearTablesAsync(typeof(TEntity));
16+
await ClearTablesAsync(dbContext, typeof(TEntity));
1717
}
1818

1919
public static async Task ClearTablesAsync<TEntity1, TEntity2>(this DbContext dbContext)
2020
where TEntity1 : class
2121
where TEntity2 : class
2222
{
23-
await dbContext.ClearTablesAsync(typeof(TEntity1), typeof(TEntity2));
23+
await ClearTablesAsync(dbContext, typeof(TEntity1), typeof(TEntity2));
2424
}
2525

2626
private static async Task ClearTablesAsync(this DbContext dbContext, params Type[] modelTypes)
@@ -40,7 +40,7 @@ private static async Task ClearTablesAsync(this DbContext dbContext, params Type
4040
{
4141
// There is no table for the specified abstract base type when using TablePerConcreteType inheritance.
4242
IEnumerable<IEntityType> derivedTypes = entityType.GetConcreteDerivedTypesInclusive();
43-
await dbContext.ClearTablesAsync(derivedTypes.Select(derivedType => derivedType.ClrType).ToArray());
43+
await ClearTablesAsync(dbContext, derivedTypes.Select(derivedType => derivedType.ClrType).ToArray());
4444
}
4545
else
4646
{

test/TestBuildingBlocks/FluentJsonElementExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static JsonElementAssertions Should(this JsonElement source)
1818
[CustomAssertion]
1919
public static SchemaReferenceIdContainer ShouldBeSchemaReferenceId(this JsonElement source, string value)
2020
{
21-
string schemaReferenceId = source.GetSchemaReferenceId();
21+
string schemaReferenceId = GetSchemaReferenceId(source);
2222
schemaReferenceId.Should().Be(value);
2323

2424
return new SchemaReferenceIdContainer(value);
@@ -38,7 +38,7 @@ public static string GetSchemaReferenceId(this JsonElement source)
3838
[CustomAssertion]
3939
public static void WithSchemaReferenceId(this JsonElement subject, [InstantHandle] Action<string> continuation)
4040
{
41-
string schemaReferenceId = subject.GetSchemaReferenceId();
41+
string schemaReferenceId = GetSchemaReferenceId(subject);
4242

4343
continuation(schemaReferenceId);
4444
}

test/TestBuildingBlocks/TimeExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public static DateTimeOffset TruncateToWholeMilliseconds(this DateTimeOffset val
1212
// Because PostgreSQL does not store the UTC offset in the database, it cannot round-trip
1313
// values with a non-zero UTC offset, and therefore always rejects such values.
1414

15-
DateTime dateTime = value.DateTime.TruncateToWholeMilliseconds();
15+
DateTime dateTime = TruncateToWholeMilliseconds(value.DateTime);
1616
return new DateTimeOffset(dateTime, TimeSpan.Zero);
1717
}
1818

0 commit comments

Comments
 (0)