-
+ @if (property.IsEnumerable) {
+
@property.Name
+
+
+ @foreach (var item in GetPropertyValue(property) ?? Enumerable.Empty
+
+ }
+ else {
+
+ }
-
-
-
+ @if (!property.IsRequired) {
+
+
+
+ }
@@ -168,19 +181,24 @@
}
}
- private TValue? GetPropertyValue
(PropertyConfig config) {
+ private TValue? GetPropertyValue(PropertyConfig config, object? listItem = null) {
if (!config.DisplayValue) return default;
if (Content.CurrentObject is null) return default;
+
+ if (listItem is not null) {
+ return (TValue)(object)_manager!.DisplayProperty(Content.CurrentObject, config, listItem);
+ }
+
var value = config.Info.GetValue(Content.CurrentObject);
if (value is null)
return default;
- if (config.Info.PropertyType == typeof(TValue))
+ if (typeof(TValue).IsAssignableFrom(config.Info.PropertyType))
return (TValue)value;
if (typeof(TValue) == typeof(string))
- return (TValue)(object)_manager!.DisplayProperty(Content.CurrentObject, config, Content.Config);
+ return (TValue)(object)_manager!.DisplayProperty(Content.CurrentObject, config);
return (TValue)Convert.ChangeType(value, typeof(TValue));
}
@@ -190,6 +208,7 @@
return;
object? result = null;
+ var needsOverride = true;
if (value is not null && config.Parser is null) {
switch (senderType) {
@@ -231,7 +250,16 @@
break;
case InputType.Relation:
- result = value;
+ if (!config.IsEnumerable)
+ result = ((IEnumerable)value).OfType