diff --git a/px-dotnet/Core/MPBase.cs b/px-dotnet/Core/MPBase.cs index dea3b75a..ce217fe8 100644 --- a/px-dotnet/Core/MPBase.cs +++ b/px-dotnet/Core/MPBase.cs @@ -402,6 +402,9 @@ protected static List FillArrayWithResponseData(Type clazz, MPAPIResponse for (int i = 0; i < jsonArray.Count(); i++) { T resource = (T)MPCoreUtils.GetResourceFromJson(clazz, (JObject)jsonArray[i]); + + resource.DumpLog(); + resource._lastKnownJson = MPCoreUtils.GetJsonFromResource(resource); resourceArray.Add(resource); } @@ -601,8 +604,9 @@ public static string ParsePath(string path, Dictionary mapPar bool search = !path.Contains(':') && mapParams != null && mapParams.Any(); string param_pattern = @":([a-z0-9_]+)"; - MatchCollection matches = Regex.Matches(path, param_pattern); - + MatchCollection matches = Regex.Matches(path, param_pattern); + + foreach (Match param in matches) { @@ -626,7 +630,9 @@ public static string ParsePath(string path, Dictionary mapPar path = path.Replace(param.Value, resource_value.ToString()); } } - + + + // URL result.Insert(0, SDK.BaseUrl); @@ -636,11 +642,18 @@ public static string ParsePath(string path, Dictionary mapPar string accessToken; // Access Token - if (string.IsNullOrEmpty(resource.MarketplaceAccessToken)) { + if (resource == null){ accessToken = SDK.GetAccessToken(); } else { - accessToken = resource.MarketplaceAccessToken; + if (string.IsNullOrEmpty(resource.MarketplaceAccessToken)) + { + accessToken = SDK.GetAccessToken(); + } else { + accessToken = resource.MarketplaceAccessToken; + } } + + Console.Out.WriteLine("STOP"); if (!string.IsNullOrEmpty(accessToken))