phronCare/phronCare.UIBlazor/Services/Sales/PeopleGroupService.cs

22 lines
528 B
C#
Raw Normal View History

using System.Net.Http.Json;
using Domain.Entities;
namespace phronCare.UIBlazor.Services.People
{
public class PeopleGroupService
{
private readonly HttpClient _http;
public PeopleGroupService(HttpClient http)
{
_http = http;
}
public async Task<List<EPeopleGroup>> GetAllAsync()
{
var result = await _http.GetFromJsonAsync<List<EPeopleGroup>>("/api/PeopleGroup/All");
return result ?? new List<EPeopleGroup>();
}
}
}