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

14 lines
419 B
C#
Raw Normal View History

2023-10-27 23:36:53 +03:00
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 } };
}
}