Added relation picker dialog

This commit is contained in:
2025-01-16 14:48:06 +01:00
parent fc85425189
commit 9d9f0ef7e4
13 changed files with 371 additions and 229 deletions

View File

@@ -3,8 +3,9 @@ using System.Reflection;
namespace HopFrame.Core.Config;
public class PropertyConfig(PropertyInfo info) {
public PropertyInfo Info { get; init; } = info;
public class PropertyConfig(PropertyInfo info, TableConfig table) {
public PropertyInfo Info { get; } = info;
public TableConfig Table { get; } = table;
public string Name { get; set; } = info.Name;
public bool List { get; set; } = true;
public bool Sortable { get; set; } = true;
@@ -17,6 +18,7 @@ public class PropertyConfig(PropertyInfo info) {
public bool Creatable { get; set; } = true;
public bool DisplayValue { get; set; } = true;
public bool IsRelation { get; set; }
public bool IsPrimaryKey { get; set; }
}
public class PropertyConfig<TProp>(PropertyConfig config) {

View File

@@ -19,7 +19,7 @@ public class TableConfig {
ContextConfig = config;
foreach (var info in tableType.GetProperties()) {
var propConfig = new PropertyConfig(info);
var propConfig = new PropertyConfig(info, this);
if (info.GetCustomAttributes(true).Any(a => a is DatabaseGeneratedAttribute)) {
propConfig.Creatable = false;