Implemented deferred entry manipulation
This commit is contained in:
@@ -74,7 +74,7 @@ internal sealed class TableManager<TModel>(DbContext context, TableConfig config
|
||||
return false;
|
||||
}
|
||||
|
||||
public async Task<string> DisplayProperty(object? item, PropertyConfig prop, object? value = null) {
|
||||
public async Task<string> DisplayProperty(object? item, PropertyConfig prop, object? value = null, object? enumerableValue = null) {
|
||||
if (item is null) return string.Empty;
|
||||
|
||||
if (prop.IsListingProperty)
|
||||
@@ -89,12 +89,12 @@ internal sealed class TableManager<TModel>(DbContext context, TableConfig config
|
||||
}
|
||||
|
||||
if (prop.IsEnumerable) {
|
||||
if (value is not null) {
|
||||
if (enumerableValue is not null) {
|
||||
if (prop.EnumerableFormatter is not null) {
|
||||
return await prop.EnumerableFormatter.Invoke(value, provider);
|
||||
return await prop.EnumerableFormatter.Invoke(enumerableValue, provider);
|
||||
}
|
||||
|
||||
return value.ToString() ?? string.Empty;
|
||||
return enumerableValue.ToString() ?? string.Empty;
|
||||
}
|
||||
|
||||
return (propValue as IEnumerable)!.OfType<object>().Count().ToString();
|
||||
|
||||
Reference in New Issue
Block a user