@using Shared.DTOs;
@using Front.Services
@inject HttpClientController hc;
@context.ID
@context.Type
@context.TaxableOrFree
@context.Vat
@*
@context.VatCustomPurposes
*@
@context.DescriptionOfID
@code {
private IEnumerable stuffDtos;
public string Value { get; set; }
protected override void OnInitialized()
{
stuffDtos = new List();
}
}
@functions {
public async Task Search()
{
if (!string.IsNullOrEmpty(Value))
{
var rsp = await hc.Get($"stuff/Getstuff/{Value}");
if (rsp.IsSuccessStatusCode)
{
stuffDtos = await rsp.Content.ReadFromJsonAsync>();
}
}
}
private async Task> DataProvider(GridDataProviderRequest request)
{
return await Task.FromResult(request.ApplyTo(stuffDtos));
}
}