@@ -10,29 +10,46 @@ public class MarketPlace
10
10
public Region Region { get ; set ; }
11
11
12
12
public Country Country { get ; set ; }
13
-
13
+
14
14
private MarketPlace ( string id , Region region , Country country )
15
15
{
16
16
ID = id ;
17
17
Region = region ;
18
18
Country = country ;
19
19
}
20
-
20
+
21
21
public static MarketPlace GetMarketPlaceByID ( string id )
22
22
{
23
- var list = new List < MarketPlace > ( ) ;
23
+ var list = new List < MarketPlace > ( ) ;
24
24
//NorthAmerica
25
25
list . Add ( US ) ; list . Add ( Canada ) ; list . Add ( Mexico ) ; list . Add ( Brazil ) ;
26
26
//Europe
27
- list . Add ( Spain ) ; list . Add ( UnitedKingdom ) ; list . Add ( France ) ; list . Add ( Netherlands ) ;
27
+ list . Add ( Spain ) ; list . Add ( UnitedKingdom ) ; list . Add ( France ) ; list . Add ( Netherlands ) ;
28
28
list . Add ( Germany ) ; list . Add ( Italy ) ; list . Add ( Sweden ) ; list . Add ( Egypt ) ;
29
29
list . Add ( Poland ) ; list . Add ( Turkey ) ; list . Add ( UnitedArabEmirates ) ; list . Add ( India ) ;
30
+ list . Add ( SaudiArabia ) ;
30
31
//FarEast
31
32
list . Add ( Singapore ) ; list . Add ( Australia ) ; list . Add ( Japan ) ;
32
33
33
34
return list . FirstOrDefault ( a => a . ID == id ) ;
34
35
}
35
36
37
+ public static MarketPlace GetMarketplaceByCountryCode ( string countryCode )
38
+ {
39
+ var list = new List < MarketPlace > ( ) ;
40
+ //NorthAmerica
41
+ list . Add ( US ) ; list . Add ( Canada ) ; list . Add ( Mexico ) ; list . Add ( Brazil ) ;
42
+ //Europe
43
+ list . Add ( Spain ) ; list . Add ( UnitedKingdom ) ; list . Add ( France ) ; list . Add ( Netherlands ) ;
44
+ list . Add ( Germany ) ; list . Add ( Italy ) ; list . Add ( Sweden ) ; list . Add ( Egypt ) ;
45
+ list . Add ( Poland ) ; list . Add ( Turkey ) ; list . Add ( UnitedArabEmirates ) ; list . Add ( India ) ;
46
+ list . Add ( SaudiArabia ) ;
47
+ //FarEast
48
+ list . Add ( Singapore ) ; list . Add ( Australia ) ; list . Add ( Japan ) ;
49
+
50
+ return list . FirstOrDefault ( a => a . Country . Code == countryCode ) ;
51
+ }
52
+
36
53
//https://docs.developer.amazonservices.com/en_UK/dev_guide/DG_Endpoints.html
37
54
38
55
//NorthAmerica
@@ -43,7 +60,7 @@ public static MarketPlace GetMarketPlaceByID(string id)
43
60
44
61
//Europe
45
62
public static MarketPlace Spain { get { return new MarketPlace ( "A1RKKUPIHCS9HS" , Region . Europe , Country . ES ) ; } }
46
- public static MarketPlace UnitedKingdom { get { return new MarketPlace ( "A1F83G8C2ARO7P" , Region . Europe , Country . GB ) ; } }
63
+ public static MarketPlace UnitedKingdom { get { return new MarketPlace ( "A1F83G8C2ARO7P" , Region . Europe , Country . GB ) ; } }
47
64
public static MarketPlace France { get { return new MarketPlace ( "A13V1IB3VIYZZH" , Region . Europe , Country . FR ) ; } }
48
65
public static MarketPlace Netherlands { get { return new MarketPlace ( "A1805IZSGTT6HS" , Region . Europe , Country . NL ) ; } }
49
66
public static MarketPlace Germany { get { return new MarketPlace ( "A1PA6795UKMFR9" , Region . Europe , Country . DE ) ; } }
@@ -68,9 +85,9 @@ public static MarketPlace GetMarketPlaceByID(string id)
68
85
69
86
}
70
87
71
-
72
88
73
-
89
+
90
+
74
91
75
92
76
93
}
0 commit comments