Added edit modal

This commit is contained in:
Leon Hoppe
2025-01-15 14:58:15 +01:00
parent ad4d9c65d6
commit d4018cceec
12 changed files with 179 additions and 19 deletions

View File

@@ -1,4 +1,6 @@
using System.Linq.Expressions;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq.Expressions;
using System.Reflection;
namespace HopFrame.Core.Config;
@@ -17,7 +19,18 @@ public class TableConfig {
ContextConfig = config;
foreach (var info in tableType.GetProperties()) {
Properties.Add(new PropertyConfig(info));
var propConfig = new PropertyConfig(info);
if (info.GetCustomAttributes(true).Any(a => a is DatabaseGeneratedAttribute)) {
propConfig.Creatable = false;
propConfig.Editable = false;
}
if (info.GetCustomAttributes(true).Any(a => a is KeyAttribute)) {
propConfig.Editable = false;
}
Properties.Add(propConfig);
}
}
}