Remove temporary DbProduct class

This commit is contained in:
Sergey Chebotar 2022-12-20 13:00:16 +03:00
parent a9ffc5510d
commit c91f231892

View File

@ -1,8 +1,8 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using RhSolutions.AddIn; using RhSolutions.AddIn;
using RhSolutions.Models;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -18,7 +18,7 @@ namespace RhSolutions.Services
string response = await httpClient.GetStringAsync(request); string response = await httpClient.GetStringAsync(request);
var products = JsonConvert.DeserializeObject<IEnumerable<DbProduct>>(response); var products = JsonConvert.DeserializeObject<IEnumerable<Product>>(response);
var product = products.FirstOrDefault(); var product = products.FirstOrDefault();
@ -28,14 +28,8 @@ namespace RhSolutions.Services
} }
else else
{ {
return $"{product.productSku} {product.name}"; return $"{product.ProductSku} {product.Name}";
} }
}
private class DbProduct
{
public string productSku { get; set; }
public string name { get; set; }
} }
} }
} }