Started working on listing page
This commit is contained in:
36
src/HopFrame.Core/Config/PropertyConfig.cs
Normal file
36
src/HopFrame.Core/Config/PropertyConfig.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
|
||||
namespace HopFrame.Core.Config;
|
||||
|
||||
public class PropertyConfig(PropertyInfo info) {
|
||||
public PropertyInfo Info { get; init; } = info;
|
||||
public string Name { get; set; } = info.Name;
|
||||
public bool List { get; set; } = true;
|
||||
public bool Sortable { get; set; } = true;
|
||||
public bool Searchable { get; set; } = true;
|
||||
}
|
||||
|
||||
public class PropertyConfig<TProp>(PropertyConfig config) {
|
||||
|
||||
public PropertyConfig<TProp> SetDisplayName(string displayName) {
|
||||
config.Name = displayName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PropertyConfig<TProp> List(bool display) {
|
||||
config.List = display;
|
||||
config.Searchable = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PropertyConfig<TProp> Sortable(bool sortable) {
|
||||
config.Sortable = sortable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PropertyConfig<TProp> Searchable(bool searchable) {
|
||||
config.Searchable = searchable;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user