Last active
April 20, 2021 12:22
-
-
Save mr5z/1d71c7d92485c8418d3cb98e81259ef9 to your computer and use it in GitHub Desktop.
Y_Y
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IProductGet : IGet<List<Product>> | |
IProductPost : IPost<Product, Product> | |
IProductDelete : IDelete<Product, long> | |
class ProductRest : | |
IProductGet, | |
IProductPost, | |
IProductDelete | |
{ | |
public async Task<List<Product>> Get(CancellationToken cancellationToken) | |
{ | |
var response = await httpClient.Get<List<Product>>(path, cancellationToken); | |
return new List<Product>(response); | |
} | |
public async Task<Product> Post(Product product, CancellationToken cancellationToken) | |
{ | |
var response = await httpClient.Post<Product>(path, product, cancellationToken); | |
return response; | |
} | |
public async Task<Product> Delete(long id, CancellationToken cancellationToken) | |
{ | |
var response = await httpClient.Delete<Product>(path, new { id }, cancellationToken); | |
return response; | |
} | |
} | |
// issues: path generation, input generation, tedious |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment