Added relation picker dialog
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user