Made admin pages dependency injectable
This commit is contained in:
10
src/HopFrame.Web.Admin/Attributes/AdminPageUrlAttribute.cs
Normal file
10
src/HopFrame.Web.Admin/Attributes/AdminPageUrlAttribute.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace HopFrame.Web.Admin.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// This attribute specifies the url of the admin page and needs to be applied on the AdminPage property in the AdminContext directly
|
||||
/// </summary>
|
||||
/// <param name="url">The page url: '/administration/{url}'</param>
|
||||
[AttributeUsage(AttributeTargets.Property)]
|
||||
public sealed class AdminPageUrlAttribute(string url) : Attribute {
|
||||
public string Url { get; set; } = url;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace HopFrame.Web.Admin.Attributes;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)]
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public sealed class AdminDescriptionAttribute(string description) : Attribute {
|
||||
public string Description { get; set; } = description;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace HopFrame.Web.Admin.Attributes.Classes;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class AdminUrlAttribute(string url) : Attribute {
|
||||
public string Url { get; set; } = url;
|
||||
}
|
||||
Reference in New Issue
Block a user