Working on Admin page modal
This commit is contained in:
@@ -23,5 +23,6 @@ public interface IAdminPageGenerator<TModel> {
|
||||
IAdminPageGenerator<TModel> ConfigureRepository<TRepository>() where TRepository : ModelRepository<TModel>;
|
||||
|
||||
IAdminPropertyGenerator Property<TProperty>(Expression<Func<TModel, TProperty>> propertyExpression);
|
||||
IAdminPageGenerator<TModel> ListingProperty<TProperty>(Expression<Func<TModel, TProperty>> propertyExpression);
|
||||
|
||||
}
|
||||
|
||||
@@ -14,5 +14,6 @@ public interface IAdminPropertyGenerator {
|
||||
IAdminPropertyGenerator Description(string description);
|
||||
IAdminPropertyGenerator Prefix(string prefix);
|
||||
IAdminPropertyGenerator Validator(Func<object, bool> validator);
|
||||
IAdminPropertyGenerator IsSelector<TSelector>();
|
||||
|
||||
}
|
||||
@@ -113,6 +113,12 @@ internal sealed class AdminPageGenerator<TModel> : IAdminPageGenerator<TModel>,
|
||||
return generator;
|
||||
}
|
||||
|
||||
public IAdminPageGenerator<TModel> ListingProperty<TProperty>(Expression<Func<TModel, TProperty>> propertyExpression) {
|
||||
var property = GetPropertyInfo(propertyExpression);
|
||||
Page.ListingProperty = property.Name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AdminPage<TModel> Compile() {
|
||||
var properties = new List<AdminPageProperty>();
|
||||
|
||||
|
||||
@@ -70,6 +70,11 @@ internal sealed class AdminPropertyGenerator(string name, Type type) : IAdminPro
|
||||
return this;
|
||||
}
|
||||
|
||||
public IAdminPropertyGenerator IsSelector<TSelector>() {
|
||||
_property.SelectorType = typeof(TSelector);
|
||||
return this;
|
||||
}
|
||||
|
||||
public AdminPageProperty Compile() {
|
||||
_property.DisplayName ??= _property.Name;
|
||||
return _property;
|
||||
|
||||
Reference in New Issue
Block a user