summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo k <mo@mokhan.ca>2012-04-23 21:51:10 -0600
committermo k <mo@mokhan.ca>2012-04-23 21:51:10 -0600
commit196275e7f0b268dd48cc3d9fd3c700d2b556faf9 (patch)
tree4cdbe968f3f3a5910929094ea351c0c16a645f19
parent35778aee3a927866eec5acfec504edd15d491f26 (diff)
use Sum<T> extension method.
-rw-r--r--src/domain/Capacity.cs10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/domain/Capacity.cs b/src/domain/Capacity.cs
index 3d4807a..4cfd1d0 100644
--- a/src/domain/Capacity.cs
+++ b/src/domain/Capacity.cs
@@ -26,15 +26,7 @@ namespace domain
public IQuantity AvailableFor(Month month)
{
- IQuantity result = new Quantity(0, new MCF());
- this
- .increases
- .Where(x => x.IsBeforeOrOn(month))
- .Each(x =>
- {
- result = result.Plus(x.IncreasedCapacity());
- });
- return result;
+ return this.increases.Where(x => x.IsBeforeOrOn(month)).Select(x => x.IncreasedCapacity()).Sum<MCF>();
}
class Increase