You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Connected.Common.Types/Common.Types.Client/TaxRates/TaxRateService.cs

57 lines
1.7 KiB

using System.Collections.Immutable;
using Connected.Net;
using Connected.Remote;
using Connected.ServiceModel;
using Connected.Services;
namespace Common.Types.TaxRates;
/// <summary>
/// This is the client implementation of the <see cref="ITaxRateService"/>.
/// </summary>
internal class TaxRateService : EntityService<int>, ITaxRateService, IRemoteService
{
public TaxRateService(IHttpService http)
{
Http = http;
}
private IHttpService Http { get; }
public async Task Delete(PrimaryKeyArgs<int> e)
{
await Http.Post("http://localhost:5063/management/commonTypes/taxRates/delete", e);
}
public async Task<int> Insert(InsertTaxRateArgs e)
{
return await Http.Post<int>("http://localhost:5063/management/commonTypes/taxRates/insert", e);
}
public async Task<ImmutableList<ITaxRate>?> Query(PrimaryKeyListArgs<int> e)
{
return (await Http.Post<List<TaxRate>?>("http://localhost:5063/management/commonTypes/taxRates/select", e)).ToImmutableList<ITaxRate>();
}
public async Task<ImmutableList<ITaxRate>?> Query(QueryArgs? args)
{
return (await Http.Post<List<TaxRate>?>("http://localhost:5063/management/commonTypes/taxRates/query", args ?? QueryArgs.NoPaging)).ToImmutableList<ITaxRate>();
}
public async Task<ITaxRate?> Select(PrimaryKeyArgs<int> e)
{
return await Http.Post<TaxRate>("http://localhost:5063/management/commonTypes/taxRates/select", e);
}
public async Task<ITaxRate?> Select(TaxRateArgs e)
{
return await Http.Post<TaxRate>("http://localhost:5063/management/commonTypes/taxRates/select", e);
}
public async Task Update(UpdateTaxRateArgs e)
{
await Http.Post<TaxRate>("http://localhost:5063/management/commonTypes/taxRates/update", e);
}
}