Made AdminPageProperty generic + added dynamic display property selecting

This commit is contained in:
2024-10-26 11:54:02 +02:00
parent 599ce2bf43
commit ce15717c7d
16 changed files with 97 additions and 68 deletions

View File

@@ -1,4 +0,0 @@
namespace HopFrame.Database.Attributes;
[AttributeUsage(AttributeTargets.Property)]
public sealed class ListingPropertyAttribute : Attribute;

View File

@@ -1,7 +1,6 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
using HopFrame.Database.Attributes;
namespace HopFrame.Database.Models;
@@ -10,7 +9,7 @@ public class Permission {
[Key, Required, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long Id { get; init; }
[Required, MaxLength(255), ListingProperty]
[Required, MaxLength(255)]
public string PermissionName { get; set; }
[Required]

View File

@@ -1,12 +1,11 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using HopFrame.Database.Attributes;
namespace HopFrame.Database.Models;
public class PermissionGroup : IPermissionOwner {
[Key, Required, MaxLength(50), ListingProperty]
[Key, Required, MaxLength(50)]
public string Name { get; init; }
[Required, DefaultValue(false)]

View File

@@ -1,6 +1,5 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
using HopFrame.Database.Attributes;
namespace HopFrame.Database.Models;
@@ -9,7 +8,7 @@ public class User : IPermissionOwner {
[Key, Required, MinLength(36), MaxLength(36)]
public Guid Id { get; init; }
[MaxLength(50), ListingProperty]
[MaxLength(50)]
public string Username { get; set; }
[Required, MaxLength(50), EmailAddress]