using FoodsharingSiegen.Contracts.Entity;
using FoodsharingSiegen.Server.Auth;
using Microsoft.AspNetCore.Components;
namespace FoodsharingSiegen.Server.BaseClasses
{
///
/// The fs base class (a. beging, 08.04.2022)
///
///
public class FsBase : ComponentBase
{
#region Dependencies (Injected)
///
/// Gets or sets the value of the auth service (ab)
///
[Inject] private AuthService? AuthService { get; set; }
#endregion
#region Override OnInitializedAsync
///
/// Ons the initialized (a. beging, 11.04.2022)
///
protected override async Task OnInitializedAsync()
{
await AuthService!.Initialize();
await base.OnInitializedAsync();
}
#endregion
///
/// Gets the value of the current user (ab)
///
protected User CurrentUser => AuthService?.User ?? new User();
}
}