Initial commit
This commit is contained in:
24
Oqtane.Client/Services/TenantService.cs
Normal file
24
Oqtane.Client/Services/TenantService.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using Oqtane.Models;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
public class TenantService : ServiceBase, ITenantService
|
||||
{
|
||||
private readonly HttpClient http;
|
||||
private readonly string apiurl;
|
||||
|
||||
public TenantService(HttpClient http, IUriHelper urihelper)
|
||||
{
|
||||
this.http = http;
|
||||
apiurl = CreateApiUrl(urihelper.GetAbsoluteUri(), "Tenant");
|
||||
}
|
||||
|
||||
public async Task<Tenant> GetTenantAsync()
|
||||
{
|
||||
return await http.GetJsonAsync<Tenant>(apiurl);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user