Refactored project to module structure
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Moonlight.Frontend.Shared.Frontend;
|
||||
|
||||
public class FrontendConfiguration
|
||||
{
|
||||
[JsonPropertyName("name")] public string Name { get; set; }
|
||||
}
|
||||
23
Moonlight.Frontend/Shared/Frontend/FrontendService.cs
Normal file
23
Moonlight.Frontend/Shared/Frontend/FrontendService.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Microsoft.JSInterop;
|
||||
|
||||
namespace Moonlight.Frontend.Shared.Frontend;
|
||||
|
||||
public class FrontendService
|
||||
{
|
||||
private readonly IJSRuntime JsRuntime;
|
||||
|
||||
public FrontendService(IJSRuntime jsRuntime)
|
||||
{
|
||||
JsRuntime = jsRuntime;
|
||||
}
|
||||
|
||||
public async Task<FrontendConfiguration> GetConfigurationAsync()
|
||||
{
|
||||
return await JsRuntime.InvokeAsync<FrontendConfiguration>("frontendConfig.getConfiguration");
|
||||
}
|
||||
|
||||
public async Task ReloadAsync()
|
||||
{
|
||||
await JsRuntime.InvokeVoidAsync("frontendConfig.reload");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user