File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -10,16 +10,20 @@ public class ParameterGetPricing : ParameterBased
10
10
public string MarketplaceId { get ; set ; }
11
11
public IList < string > Asins { get ; set ; }
12
12
public IList < string > Skus { get ; set ; }
13
- public ItemType ItemType { get {
14
- if ( Asins != null && Asins . Count > 0 && Skus != null && Skus . Count > 0 )
13
+ public ItemType ItemType
14
+ {
15
+ get
16
+ {
17
+ if ( Asins != null && Asins . Count > 0 && Skus != null && Skus . Count > 0 )
15
18
throw new ArgumentException ( "Only allowed to fill Asins or Skus you cant have both" ) ;
16
19
if ( Asins != null && Asins . Count > 0 )
17
20
return ItemType . Asin ;
18
21
if ( Skus != null && Skus . Count > 0 )
19
22
return ItemType . Sku ;
20
23
21
24
throw new ArgumentException ( "You cant request without fill Skus or Asins , you need to fill only of them only" ) ;
22
- } }
25
+ }
26
+ }
23
27
public ItemCondition ? ItemCondition { get ; set ; }
24
28
public OfferTypeEnum ? OfferType { get ; set ; } = OfferTypeEnum . B2C ;
25
29
}
Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ public IList<Price> GetPricing(ParameterGetPricing parameterGetPricing) =>
20
20
Task . Run ( ( ) => GetPricingAsync ( parameterGetPricing ) ) . ConfigureAwait ( false ) . GetAwaiter ( ) . GetResult ( ) ;
21
21
public async Task < IList < Price > > GetPricingAsync ( ParameterGetPricing parameterGetPricing )
22
22
{
23
+ if ( string . IsNullOrEmpty ( parameterGetPricing . MarketplaceId ) )
24
+ {
25
+ parameterGetPricing . MarketplaceId = AmazonCredential . MarketPlace . ID ;
26
+ }
27
+
23
28
var param = parameterGetPricing . getParameters ( ) ;
24
29
25
30
await CreateAuthorizedRequestAsync ( ProductPricingApiUrls . GetPricing , RestSharp . Method . GET , param ) ;
You can’t perform that action at this time.
0 commit comments