Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Various (non-breaking) name changes for internal consistency
  • Loading branch information
bkoelman committed Apr 20, 2023
commit 9e03e0f4c2eb671c3516a9efb1dcaabb5f6603df
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ private object ConvertStringToType(string value, Type type)

private Converter<string, object> GetConstantValueConverterForAttribute(AttrAttribute attribute)
{
return stringValue => attribute.Property.Name == nameof(IIdentifiable<object>.Id)
return stringValue => attribute.Property.Name == nameof(Identifiable<object>.Id)
? DeObfuscateStringId(attribute.Type.ClrType, stringValue)
: ConvertStringToType(stringValue, attribute.Property.PropertyType);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ private void IncludeAllScalarProperties(Type elementType, Dictionary<PropertyInf

private static void IncludeFields(FieldSelectors fieldSelectors, Dictionary<PropertyInfo, PropertySelector> propertySelectors)
{
foreach ((ResourceFieldAttribute resourceField, QueryLayer? queryLayer) in fieldSelectors)
foreach ((ResourceFieldAttribute resourceField, QueryLayer? nextLayer) in fieldSelectors)
{
var propertySelector = new PropertySelector(resourceField.Property, queryLayer);
var propertySelector = new PropertySelector(resourceField.Property, nextLayer);
IncludeWritableProperty(propertySelector, propertySelectors);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ public async Task Cannot_select_ToMany_relationship_with_blocked_capability()
}

[Fact]
public async Task Retrieves_all_properties_when_fieldset_contains_readonly_attribute()
public async Task Fetches_all_scalar_properties_when_fieldset_contains_readonly_attribute()
{
// Arrange
var store = _testContext.Factory.Services.GetRequiredService<ResourceCaptureStore>();
Expand Down
10 changes: 5 additions & 5 deletions test/TestBuildingBlocks/DbContextExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ public static async Task ClearTablesAsync<TEntity1, TEntity2>(this DbContext dbC
await ClearTablesAsync(dbContext, typeof(TEntity1), typeof(TEntity2));
}

private static async Task ClearTablesAsync(this DbContext dbContext, params Type[] models)
private static async Task ClearTablesAsync(this DbContext dbContext, params Type[] modelTypes)
{
foreach (Type model in models)
foreach (Type modelType in modelTypes)
{
IEntityType? entityType = dbContext.Model.FindEntityType(model);
IEntityType? entityType = dbContext.Model.FindEntityType(modelType);

if (entityType == null)
{
throw new InvalidOperationException($"Table for '{model.Name}' not found.");
throw new InvalidOperationException($"Table for '{modelType.Name}' not found.");
}

string? tableName = entityType.GetTableName();
Expand All @@ -44,7 +44,7 @@ private static async Task ClearTablesAsync(this DbContext dbContext, params Type
}
else
{
await dbContext.Database.ExecuteSqlRawAsync($"delete from \"{tableName}\"");
await dbContext.Database.ExecuteSqlRawAsync($"DELETE FROM \"{tableName}\"");
}
}
}
Expand Down