32 lines
756 B
C#
32 lines
756 B
C#
using e_suite.CustomerApi.exceptions;
|
|
|
|
namespace e_suite.CustomerApi;
|
|
|
|
public sealed class ApiSettings
|
|
{
|
|
private static readonly Lazy<ApiSettings> LazyInstance = new(() => new ApiSettings());
|
|
private string _token = "";
|
|
|
|
private ApiSettings()
|
|
{
|
|
|
|
}
|
|
|
|
public static ApiSettings Instance => LazyInstance.Value;
|
|
|
|
public Uri BaseUrl { get; set; } = new Uri("https://localhost:7066/api/");
|
|
|
|
public string Token
|
|
{
|
|
get
|
|
{
|
|
if (string.IsNullOrWhiteSpace(_token))
|
|
{
|
|
throw new NotLoggedInException("You must be logged in to call this API Function");
|
|
}
|
|
|
|
return _token;
|
|
}
|
|
set => _token = value;
|
|
}
|
|
} |