49 lines
1.5 KiB
C#
49 lines
1.5 KiB
C#
using System;
|
|
using System.Diagnostics;
|
|
using GerstITS.System.Configurations;
|
|
using GerstITS.Web.Api.Swagger;
|
|
|
|
namespace GerstITS.Examples.Api.Swagger
|
|
{
|
|
internal class WebApiConfiguration : ISwaggerConfiguration, IConfiguration
|
|
{
|
|
#region Constructors
|
|
|
|
public WebApiConfiguration()
|
|
{
|
|
var currentAssembly = typeof(WebApiConfiguration).Assembly;
|
|
var fileVersionInfo = FileVersionInfo.GetVersionInfo(currentAssembly.Location);
|
|
|
|
Company = fileVersionInfo.CompanyName;
|
|
Name = fileVersionInfo.ProductName;
|
|
Release = currentAssembly.GetName().Version;
|
|
|
|
TermsOfService = new Uri("https://en.wikipedia.org/wiki/Terms_of_service");
|
|
License = new LicenseConfiguration
|
|
{
|
|
Name = "MIT",
|
|
Url = new Uri("https://opensource.org/licenses/MIT")
|
|
};
|
|
SupportEMail = "info@examples.net";
|
|
|
|
Security = new SwaggerSecurityConfiguration
|
|
{
|
|
AllowAnonymous = true
|
|
};
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ISwaggerConfiguration
|
|
|
|
public string Name { get; }
|
|
public string Company { get; }
|
|
public string SupportEMail { get; }
|
|
public Uri TermsOfService { get; }
|
|
public ILicense License { get; }
|
|
public Version Release { get; }
|
|
public IOpenApiSecuritySchemeConfiguration Security { get; }
|
|
|
|
#endregion
|
|
}
|
|
} |