This commit is contained in:
Tomek Melissa 2020-03-12 12:25:36 +01:00
Родитель 3ca45bb72f
Коммит a0014b3dd0
1 изменённых файлов: 15 добавлений и 8 удалений

Просмотреть файл

@ -349,10 +349,17 @@ namespace LCS
responseBody = responseBody.TrimStart('(');
responseBody = responseBody.TrimEnd(')');
var cloudHostedInstancesUnsorted = JsonConvert.DeserializeObject<Dictionary<string, CloudHostedInstance>>(responseBody);
if (cloudHostedInstancesUnsorted != null)
try
{
list.AddRange(cloudHostedInstancesUnsorted.Values.OrderBy(x => x.InstanceId));
var cloudHostedInstancesUnsorted = JsonConvert.DeserializeObject<Dictionary<string, CloudHostedInstance>>(responseBody);
if (cloudHostedInstancesUnsorted != null)
{
list.AddRange(cloudHostedInstancesUnsorted.Values.OrderBy(x => x.InstanceId));
}
}
catch
{
return list;
}
return list;
}
@ -365,16 +372,16 @@ namespace LCS
var responseBody = result.Content.ReadAsStringAsync().Result;
var response = JsonConvert.DeserializeObject<Response>(responseBody);
var settings = new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore,
MissingMemberHandling = MissingMemberHandling.Ignore
};
var list = new List<CloudHostedInstance>();
if (response.Success)
{
if (response.Data == null) return list;
var settings = new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore,
MissingMemberHandling = MissingMemberHandling.Ignore
};
var cloudHostedInstancesUnsorted = JsonConvert.DeserializeObject<Dictionary<string, CloudHostedInstance>>(response.Data.ToString(), settings);
if (cloudHostedInstancesUnsorted != null)
{