File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
src/BehavioralPatterns/Strategy/StrategyLibrary Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using BuildingBlocks ;
3
3
using StrategyLibrary . ShippingExample . ShippingProviders ;
4
+ using StrategyLibrary . ShippingExample . ShippingProviders . Common ;
4
5
5
6
namespace StrategyLibrary . ShippingExample
6
7
{
@@ -39,7 +40,7 @@ public static void Execute()
39
40
Description = "Xiaomi Mi 10T Pro" ,
40
41
} ;
41
42
42
- var fedEx = new FedEx ( ) ;
43
+ IShippingProvider fedEx = new FedEx ( ) ;
43
44
var shippingCostCalculationService = new ShippingCostCalculationService ( fedEx ) ;
44
45
45
46
var price = shippingCostCalculationService . Calculate ( order ) ;
Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using BuildingBlocks ;
3
3
using StrategyLibrary . SortingExample . Strategies ;
4
+ using StrategyLibrary . SortingExample . Strategies . Common ;
4
5
5
6
namespace StrategyLibrary . SortingExample
6
7
{
@@ -10,7 +11,7 @@ public static void Execute()
10
11
{
11
12
ConsoleExtension . WriteSeparator ( "Sorting example" ) ;
12
13
13
- var sortStrategy = new SortByFirstName ( ) ;
14
+ ISortStrategy sortStrategy = new SortByFirstName ( ) ;
14
15
var sortablePersons = new SortablePersons ( sortStrategy ) ;
15
16
16
17
sortablePersons . Add ( new Person ( "Dennis" , "Ritchie" , 1941 ) ) ;
You can’t perform that action at this time.
0 commit comments