using FoodsharingSiegen.Contracts.Entity; using FoodsharingSiegen.Server.Auth; namespace FoodsharingSiegen.Server.Data.Service { /// /// The service base class (a. beging, 23.05.2022) /// public class ServiceBase { #region Public Properties /// /// Gets the value of the auth service (ab) /// public AuthService AuthService { get; } #endregion #region Setup/Teardown //////////////////////////////////////////////////////////////////////////////////////////////////// /// Specialised constructor for use only by derived class. /// /// A Beging, 20.10.2021. /// /// The context. /// //////////////////////////////////////////////////////////////////////////////////////////////////// protected ServiceBase(FsContext context, AuthService authService) { Context = context; AuthService = authService; } #endregion /// /// Gets the value of the current user (ab) /// protected User? CurrentUser => AuthService.User; //////////////////////////////////////////////////////////////////////////////////////////////////// /// Database Context /// /// The context. //////////////////////////////////////////////////////////////////////////////////////////////////// protected FsContext Context { get; } } }