2017-05-12 16:29:47 +02:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2017-05-27 16:22:58 +02:00
|
|
|
using Yavsc.Billing;
|
2017-06-02 10:13:55 +02:00
|
|
|
using Yavsc.Models.Billing;
|
2017-05-12 16:29:47 +02:00
|
|
|
|
|
|
|
|
namespace Yavsc.Helpers
|
|
|
|
|
{
|
|
|
|
|
public static class BillingHelpers
|
|
|
|
|
{
|
|
|
|
|
public static decimal Addition(this List<IBillItem> items) => items.Aggregate<IBillItem, decimal>(0m, (t, l) => t + l.Count * l.UnitaryCost);
|
|
|
|
|
|
2017-06-02 10:13:55 +02:00
|
|
|
public static decimal Addition(this List<CommandLine> items) => items.Select(i=>((IBillItem)i)).ToList().Addition();
|
|
|
|
|
|
2017-05-12 16:29:47 +02:00
|
|
|
}
|
|
|
|
|
}
|