Skip to content

Commit 81c4afc

Browse files
committed
Various (non-breaking) name changes for internal consistency
1 parent 05e9037 commit 81c4afc

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/JsonApiDotNetCore/Queries/Internal/Parsing/FilterParser.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ private object ConvertStringToType(string value, Type type)
420420

421421
private Converter<string, object> GetConstantValueConverterForAttribute(AttrAttribute attribute)
422422
{
423-
return stringValue => attribute.Property.Name == nameof(IIdentifiable<object>.Id)
423+
return stringValue => attribute.Property.Name == nameof(Identifiable<object>.Id)
424424
? DeObfuscateStringId(attribute.Type.ClrType, stringValue)
425425
: ConvertStringToType(stringValue, attribute.Property.PropertyType);
426426
}

src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/SelectClauseBuilder.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ private void IncludeAllScalarProperties(Type elementType, Dictionary<PropertyInf
162162

163163
private static void IncludeFields(FieldSelectors fieldSelectors, Dictionary<PropertyInfo, PropertySelector> propertySelectors)
164164
{
165-
foreach ((ResourceFieldAttribute resourceField, QueryLayer? queryLayer) in fieldSelectors)
165+
foreach ((ResourceFieldAttribute resourceField, QueryLayer? nextLayer) in fieldSelectors)
166166
{
167-
var propertySelector = new PropertySelector(resourceField.Property, queryLayer);
167+
var propertySelector = new PropertySelector(resourceField.Property, nextLayer);
168168
IncludeWritableProperty(propertySelector, propertySelectors);
169169
}
170170
}

test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ public async Task Cannot_select_ToMany_relationship_with_blocked_capability()
791791
}
792792

793793
[Fact]
794-
public async Task Retrieves_all_properties_when_fieldset_contains_readonly_attribute()
794+
public async Task Fetches_all_scalar_properties_when_fieldset_contains_readonly_attribute()
795795
{
796796
// Arrange
797797
var store = _testContext.Factory.Services.GetRequiredService<ResourceCaptureStore>();

test/TestBuildingBlocks/DbContextExtensions.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ public static async Task ClearTablesAsync<TEntity1, TEntity2>(this DbContext dbC
2323
await ClearTablesAsync(dbContext, typeof(TEntity1), typeof(TEntity2));
2424
}
2525

26-
private static async Task ClearTablesAsync(this DbContext dbContext, params Type[] models)
26+
private static async Task ClearTablesAsync(this DbContext dbContext, params Type[] modelTypes)
2727
{
28-
foreach (Type model in models)
28+
foreach (Type modelType in modelTypes)
2929
{
30-
IEntityType? entityType = dbContext.Model.FindEntityType(model);
30+
IEntityType? entityType = dbContext.Model.FindEntityType(modelType);
3131

3232
if (entityType == null)
3333
{
34-
throw new InvalidOperationException($"Table for '{model.Name}' not found.");
34+
throw new InvalidOperationException($"Table for '{modelType.Name}' not found.");
3535
}
3636

3737
string? tableName = entityType.GetTableName();
@@ -44,7 +44,7 @@ private static async Task ClearTablesAsync(this DbContext dbContext, params Type
4444
}
4545
else
4646
{
47-
await dbContext.Database.ExecuteSqlRawAsync($"delete from \"{tableName}\"");
47+
await dbContext.Database.ExecuteSqlRawAsync($"DELETE FROM \"{tableName}\"");
4848
}
4949
}
5050
}

0 commit comments

Comments
 (0)