Update to latest code and nugets packages

This commit is contained in:
2026-07-03 14:43:35 +02:00
parent 5530dc915e
commit 3a36978997
25 changed files with 339 additions and 116 deletions
@@ -1,4 +1,5 @@
using GerstITS.Authentication.OpenId;
using GerstITS.Authentication.ApiKey;
using GerstITS.Authentication.OpenId;
using GerstITS.Data.EntityFramework;
using GerstITS.System.Configurations;
using GerstITS.Web.Api.Builder;
@@ -11,6 +12,7 @@ internal sealed class WebApiConfiguration : GerstITS.System.Configurations.IConf
#region Properties
public IServerConfiguration Server { get; }
public IApiKeyConfiguration ApiKey { get; }
public IOpenIdConfiguration OpenId { get; }
public ISwaggerConfiguration Swagger { get; set; }
public IEntityFrameworkMigrationConfiguration EntityFrameworkMigration { get; set; }
@@ -24,7 +26,8 @@ internal sealed class WebApiConfiguration : GerstITS.System.Configurations.IConf
var prefix = this.ToConfigurationPrefix();
EntityFrameworkMigration = new EntityFrameworkMigrationConfiguration(prefix, configuration);
//OpenId = new OpenIdConfiguration(prefix, configuration);
ApiKey = new ApiKeyConfiguration(prefix, configuration);
OpenId = new OpenIdConfiguration(prefix, configuration);
Server = new ServerConfiguration(prefix, configuration);
Swagger = new SwaggerConfiguration(prefix, configuration);
}
@@ -7,14 +7,14 @@ namespace GerstITS.Examples.Api.StartupTasks;
internal class ExampleStartupTask : IStartupTask
{
#region Fields#
#region Fields
private readonly IExampleProvider _provider;
private readonly IJsonConvert _jsonConvert;
#endregion
#region Construtcors
#region Constructors
public ExampleStartupTask(IExampleProvider provider,
IJsonConvert jsonConvert)
@@ -6,7 +6,7 @@
<Copyright>© 2025 Gerst ITS</Copyright>
<Authors>Gerst ITS</Authors>
<Product>Gerst ITS Examples Web Api</Product>
<Description>Exapmle Web Api</Description>
<Description>Example Web Api</Description>
<Version>0.0.0.0</Version>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyInformationalVersion>0.0.0.0</AssemblyInformationalVersion>
@@ -18,7 +18,7 @@
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<WarningsAsErrors />
<NoWarn>1591</NoWarn>
<DocumentationFile>bin\Release\net8.0\GerstITS.Example.Api.xml</DocumentationFile>
<DocumentationFile>bin\Debug\net10.0\GerstITS.Examples.Api.xml</DocumentationFile>
<OutputPath></OutputPath>
</PropertyGroup>
@@ -27,18 +27,23 @@
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<WarningsAsErrors />
<NoWarn>1591</NoWarn>
<DocumentationFile>bin\Release\net8.0\GerstITS.Example.Api.xml</DocumentationFile>
<DocumentationFile>bin\Release\net10.0\GerstITS.Examples.Api.xml</DocumentationFile>
<OutputPath></OutputPath>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="GerstITS.Authentication.ApiKey" />
<PackageReference Include="GerstITS.Authentication.OpenId" />
<PackageReference Include="GerstITS.Data.EntityFramework" />
<PackageReference Include="GerstITS.Mail" />
<PackageReference Include="GerstITS.System" />
<PackageReference Include="GerstITS.Web" />
<PackageReference Include="GerstITS.Web.Api.Swagger" />
<PackageReference Include="Serilog.AspNetCore" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GerstITS.Examples.Data\GerstITS.Examples.Data.csproj" />
<ProjectReference Include="..\GerstITS.Examples.Logic\GerstITS.Examples.Logic.csproj" />
</ItemGroup>
@@ -11,6 +11,7 @@ public sealed partial class Module
container.AddSingleton<WebApiConfiguration>();
container.AddSingleton(c => c.GetService<WebApiConfiguration>().EntityFrameworkMigration);
container.AddSingleton(c => c.GetService<WebApiConfiguration>().ApiKey);
container.AddSingleton(c => c.GetService<WebApiConfiguration>().OpenId);
container.AddSingleton(c => c.GetService<WebApiConfiguration>().Server);
container.AddSingleton(c => c.GetService<WebApiConfiguration>().Swagger);
+1
View File
@@ -10,6 +10,7 @@ public sealed partial class Module : IIoCModule<IServiceCollection>
{
RegisterConfigurations(container);
RegisterExceptionHandling(container);
RegisterSession(container);
RegisterStartupTasks(container);
}
+1
View File
@@ -31,6 +31,7 @@ public class Program
.UseAuthentication()
.UseAuthorization()
.UseRouting()
.UseSession()
.UseEndpoints(endpoints => endpoints.MapControllers())
.UseRewriteUnknownPathsToIndexSite(ApplicationEnvironment.WebApi.BaseUrl)
.UseSystemIndependentStaticFiles()
+17 -1
View File
@@ -7,7 +7,23 @@
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"CustomerDbContext": "Host=localhost;Port=5432;Database=gerstits_examples;Username=postgres;Password=postgres"
},
"Mail": {
"SmtpServer": "smtp.example.com",
"SmtpPort": 587,
"SenderDisplayName": "Gerst ITS Examples",
"SenderAddress": "noreply@example.com",
"Username": "noreply@example.com",
"Password": "change-me",
"UseSsl": true
},
"WebApi": {
"ApiKey": {
"Header": "X-Api-Key",
"Key": "example-api-key"
},
"Swagger": {
"SupportEMail": "support@example.com",
"TermsOfService": "https://www.example.com/impressum/",
@@ -16,7 +32,7 @@
"Url": "https://opensource.org/licenses/MIT"
}
},
"EntityFrameworkmigration": {
"EntityFrameworkMigration": {
"AutoMigrate": true
},
"Server": {