示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OrderController"/> class.
        /// FeatureFlag logic outside the code
        /// </summary>
        public OrderController()
        {
            _orderSystem = new OrderSystem();

            // let the feature flag determine which calculator to use
            if (NewPostageCalculationFeature.FeatureEnabled)
            {
                _postageCalculator = new AdvancedPostageCalculator();
            }
            else
            {
                _postageCalculator = new PostageCalculator();
            }
        }
示例#2
0
 public double Accept(IPostageCalculator calculator)
 {
     return(calculator.Visit(this));
 }
示例#3
0
 public double Accept(IPostageCalculator calculator)
 {
     return calculator.Visit(this);
 }
 public BusySeasonCalculator(IPostageCalculator postageCalculator)
 {
     this.postageCalculator = postageCalculator;
 }
 public PostageCalculator(IPostageCalculator calculator)
 {
     this.calculator = calculator;
 }
 public PostageCalculator(IPostageCalculator calculator)
 {
     this.calculator = calculator;
 }
 public BusySeasonCalculator(IPostageCalculator postageCalculator)
 {
     this.postageCalculator = postageCalculator;
 }