Skip to content

Instantly share code, notes, and snippets.

@litichevskiydv
Last active December 17, 2017 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save litichevskiydv/fb9f88a46b6eb1141d78a0d260920b9a to your computer and use it in GitHub Desktop.
Save litichevskiydv/fb9f88a46b6eb1141d78a0d260920b9a to your computer and use it in GitHub Desktop.
public class PrintOrderCostCalculationService : IPrintOrderCostCalculationService
{
private readonly IEnumerable<IExpensesCalculator> _expensesCalculators;
public PrintOrderCostCalculationService(IEnumerable<IExpensesCalculator> expensesCalculators)
{
_expensesCalculators = expensesCalculators;
}
public double Calculate(PrintOrder order)
{
return _expensesCalculators.Sum(x => x.Calculate(order));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment