RhSolutions-AddIn/RhSolutions.AddIn/Services/GrpcClient.cs

14 lines
419 B
C#

using System.Threading.Tasks;
namespace RhSolutions.Services;
public class GrpcClient : IDatabaseClient
{
public async Task<IEnumerable<Product>> GetProducts(string query)
{
var reply = await RhSolutionsAddIn.GrpcClient
.GetProductAsync(new ProductRequest() { Query = query });
return new[] { new Product(reply.Id) { Name = reply.Name, Price = (decimal)reply.Price } };
}
}