Last active
December 27, 2015 16:39
-
-
Save beyond-code-github/7356474 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class IndividualResult<T> { | |
| public bool WasCalculated { get; set; } | |
| public T Result { get; set; } | |
| } | |
| public class CalculatesThings { | |
| private PropertyACalculator<AType> propertyACalculator; | |
| private PropertyBCalculator<BType> propertyBCalculator; | |
| private PropertyCCalculator<CType> propertyCCalculator; | |
| private PropertyDCalculator<DType> propertyDCalculator; | |
| public CalculatesThings(propertyACalculator, propertyBCalculator, propertyCCalculator, propertyDCalculator) { | |
| this.propertyACalculator = propertyACalculator; | |
| this.propertyBCalculator = propertyBCalculator; | |
| this.propertyCCalculator = propertyCCalculator; | |
| this.propertyDCalculator = propertyDCalculator; | |
| } | |
| public CalculationResult GetResult(InputData input, IEnumerable names) { | |
| return new CalculationResult() { | |
| PropertyAResult = this.propertyACalculator.Calculate(input, names), | |
| PropertyBResult = this.propertyBCalculator.Calculate(input, names), | |
| PropertyCResult = this.propertyCCalculator.Calculate(input, names), | |
| PropertyDResult = this.propertyDCalculator.Calculate(input, names), | |
| }; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment