using Blazorise;
using FoodsharingSiegen.Contracts.Entity;
using FoodsharingSiegen.Server.Auth;
using FoodsharingSiegen.Server.Data;
using FoodsharingSiegen.Server.Data.Service;
using Microsoft.AspNetCore.Components;
namespace FoodsharingSiegen.Server.BaseClasses
{
///
/// The fs base class (a. beging, 08.04.2022)
///
///
public class FsBase : ComponentBase
{
#region Override OnInitializedAsync
///
/// Ons the initialized (a. beging, 11.04.2022)
///
protected override async Task OnInitializedAsync()
{
await AuthService!.Initialize();
await base.OnInitializedAsync();
}
#endregion
#region Dependencies (Injected)
///
/// Gets or sets the value of the auth service (ab)
///
[Inject] private AuthService? AuthService { get; set; }
///
/// Gets or sets the value of the audit service (ab)
///
[Inject] private AuditService? AuditService { get; set; }
///
/// Gets or sets the value of the notification (ab)
///
[Inject] protected INotificationService? Notification { get; set; }
///
/// Gets or sets the value of the message (ab)
///
[Inject] protected IMessageService? Message { get; set; }
///
/// Gets or sets the value of the navigation manager (ab)
///
[Inject] protected NavigationManager? NavigationManager { get; set; }
#endregion
///
/// Refreshes the state (a. beging, 21.05.2022)
///
protected async Task RefreshState()
{
await AuthService?.RefreshState()!;
}
///
/// Gets the value of the current user (ab)
///
protected User CurrentUser => AuthService?.User ?? new User();
}
}