Added relation support

This commit is contained in:
Leon Hoppe
2025-01-15 08:02:23 +01:00
parent c4c0424559
commit ad4d9c65d6
12 changed files with 93 additions and 15 deletions

View File

@@ -1,4 +1,5 @@
using System.Reflection;
using System.Linq.Expressions;
using System.Reflection;
namespace HopFrame.Core.Config;
@@ -8,6 +9,7 @@ public class PropertyConfig(PropertyInfo info) {
public bool List { get; set; } = true;
public bool Sortable { get; set; } = true;
public bool Searchable { get; set; } = true;
public PropertyInfo? DisplayedProperty { get; set; }
}
public class PropertyConfig<TProp>(PropertyConfig config) {
@@ -32,5 +34,10 @@ public class PropertyConfig<TProp>(PropertyConfig config) {
config.Searchable = searchable;
return this;
}
public PropertyConfig<TProp> DisplayedProperty<TInnerProp>(Expression<Func<TProp, TInnerProp>> propertyExpression) {
config.DisplayedProperty = TableConfig<TProp>.GetPropertyInfo(propertyExpression);
return this;
}
}