12345678910111213141516171819202122 |
- using System;
- using System.Collections.Generic;
- using System.Linq.Expressions;
- using InABox.Core;
- namespace Comal.Classes
- {
- public class FreeStockAggregate : CoreAggregate<Product, StockMovement, double>
- {
- public override Expression<Func<StockMovement, double>> Aggregate => x => x.Qty;
- public override Filter<StockMovement> Filter => new Filter<StockMovement>(x => x.Job).NotLinkValid();
- public override Dictionary<Expression<Func<StockMovement, object>>, Expression<Func<Product, object>>> Links =>
- new Dictionary<Expression<Func<StockMovement, object>>, Expression<Func<Product, object>>>()
- {
- { StockMovement => StockMovement.Product.ID, Product => Product.ID }
- };
- public override AggregateCalculation Calculation => AggregateCalculation.Sum;
- }
- }
|