first commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using BethanysPieShopHRM.Shared.Domain;
|
||||
using System.Net.Http.Json;
|
||||
|
||||
namespace Webshop.App.Services
|
||||
{
|
||||
public class JobCategoryDataService : IJobCategoryDataService
|
||||
{
|
||||
private readonly HttpClient _httpClient;
|
||||
|
||||
public JobCategoryDataService(
|
||||
HttpClient httpClient)
|
||||
{
|
||||
_httpClient = httpClient;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<JobCategory>> GetJobCategories()
|
||||
{
|
||||
return await _httpClient.GetFromJsonAsync<IEnumerable<JobCategory>>("/api/jobcategory");
|
||||
}
|
||||
|
||||
public async Task<JobCategory> GetJobCategoryById(int jobCategoryId)
|
||||
{
|
||||
return await _httpClient.GetFromJsonAsync<JobCategory>($"/api/jobcategory/{jobCategoryId}");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user