Skip to content

Commit dc039ad

Browse files
committed
small fix
1 parent ce70563 commit dc039ad

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Source/FikaAmazonAPI/Parameter/ProductPricing/ParameterGetPricing.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,20 @@ public class ParameterGetPricing : ParameterBased
1010
public string MarketplaceId { get; set; }
1111
public IList<string> Asins { get; set; }
1212
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)
1518
throw new ArgumentException("Only allowed to fill Asins or Skus you cant have both");
1619
if (Asins != null && Asins.Count > 0)
1720
return ItemType.Asin;
1821
if (Skus != null && Skus.Count > 0)
1922
return ItemType.Sku;
2023

2124
throw new ArgumentException("You cant request without fill Skus or Asins , you need to fill only of them only");
22-
} }
25+
}
26+
}
2327
public ItemCondition? ItemCondition { get; set; }
2428
public OfferTypeEnum? OfferType { get; set; } = OfferTypeEnum.B2C;
2529
}

Source/FikaAmazonAPI/Services/ProductPricingService.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ public IList<Price> GetPricing(ParameterGetPricing parameterGetPricing) =>
2020
Task.Run(() => GetPricingAsync(parameterGetPricing)).ConfigureAwait(false).GetAwaiter().GetResult();
2121
public async Task<IList<Price>> GetPricingAsync(ParameterGetPricing parameterGetPricing)
2222
{
23+
if (string.IsNullOrEmpty(parameterGetPricing.MarketplaceId))
24+
{
25+
parameterGetPricing.MarketplaceId = AmazonCredential.MarketPlace.ID;
26+
}
27+
2328
var param = parameterGetPricing.getParameters();
2429

2530
await CreateAuthorizedRequestAsync(ProductPricingApiUrls.GetPricing, RestSharp.Method.GET, param);

0 commit comments

Comments
 (0)