|
@@ -6,38 +6,38 @@ using System.Linq.Expressions;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
-namespace InABox.DynamicGrid
|
|
|
+namespace InABox.DynamicGrid;
|
|
|
+
|
|
|
+public abstract class DynamicCrossJoinGrid<TEntity, TLeft> : DynamicDataGrid<TEntity>
|
|
|
+ where TEntity : Entity, IRemotable, IPersistent, new()
|
|
|
+ where TLeft : Entity
|
|
|
{
|
|
|
- public abstract class DynamicCrossJoinGrid<TEntity, TLeft> : DynamicDataGrid<TEntity>
|
|
|
- where TEntity : Entity, IRemotable, IPersistent, new()
|
|
|
- where TLeft : Entity
|
|
|
- {
|
|
|
-
|
|
|
- public TLeft? Left { get; set; }
|
|
|
- public abstract Expression<Func<TEntity, Guid>> LeftMapping { get; }
|
|
|
- public abstract Expression<Func<TLeft, Guid>> LeftProperty { get; }
|
|
|
+
|
|
|
+ public TLeft? Left { get; set; }
|
|
|
+ public abstract Expression<Func<TEntity, Guid>> LeftMapping { get; }
|
|
|
+ public abstract Expression<Func<TLeft, Guid>> LeftProperty { get; }
|
|
|
|
|
|
- protected override void DoReconfigure(FluentList<DynamicGridOption> options)
|
|
|
- {
|
|
|
- base.DoReconfigure(options);
|
|
|
- options.BeginUpdate().Clear().Add(DynamicGridOption.SelectColumns).EndUpdate();
|
|
|
- }
|
|
|
+ protected override void DoReconfigure(FluentList<DynamicGridOption> options)
|
|
|
+ {
|
|
|
+ base.DoReconfigure(options);
|
|
|
+ options.BeginUpdate().Clear().Add(DynamicGridOption.SelectColumns).EndUpdate();
|
|
|
+ }
|
|
|
|
|
|
- protected override void GenerateColumns(DynamicGridColumns columns)
|
|
|
- {
|
|
|
- base.GenerateColumns(columns);
|
|
|
- var prefix = $"{typeof(TLeft).Name}.";
|
|
|
- columns.RemoveAll(x => x.ColumnName.StartsWith(prefix));
|
|
|
- }
|
|
|
+ public override DynamicGridColumns GenerateColumns()
|
|
|
+ {
|
|
|
+ var columns = base.GenerateColumns();
|
|
|
+ var prefix = $"{typeof(TLeft).Name}.";
|
|
|
+ columns.RemoveAll(x => x.ColumnName.StartsWith(prefix));
|
|
|
+ return columns;
|
|
|
+ }
|
|
|
|
|
|
- protected override void Reload(Filters<TEntity> criteria, Columns<TEntity> columns, ref SortOrder<TEntity>? sort, Action<CoreTable?, Exception?> action)
|
|
|
- {
|
|
|
- var filter = new Filter<TEntity>();
|
|
|
- filter.Expression = CoreUtils.ExtractMemberExpression<TEntity, Guid>(LeftMapping);
|
|
|
- filter.Operator = Operator.IsEqualTo;
|
|
|
- filter.Value = CoreUtils.GetPropertyValue(Left, CoreUtils.GetFullPropertyName(LeftProperty, "."));
|
|
|
- criteria.Add(filter);
|
|
|
- base.Reload(criteria, columns, ref sort, action);
|
|
|
- }
|
|
|
+ protected override void Reload(Filters<TEntity> criteria, Columns<TEntity> columns, ref SortOrder<TEntity>? sort, Action<CoreTable?, Exception?> action)
|
|
|
+ {
|
|
|
+ var filter = new Filter<TEntity>();
|
|
|
+ filter.Expression = CoreUtils.ExtractMemberExpression<TEntity, Guid>(LeftMapping);
|
|
|
+ filter.Operator = Operator.IsEqualTo;
|
|
|
+ filter.Value = CoreUtils.GetPropertyValue(Left, CoreUtils.GetFullPropertyName(LeftProperty, "."));
|
|
|
+ criteria.Add(filter);
|
|
|
+ base.Reload(criteria, columns, ref sort, action);
|
|
|
}
|
|
|
}
|