Fixed dependencies and config
continuous-integration/drone/pr Build is passing

This commit is contained in:
Khwezi Mngoma
2026-05-23 12:05:47 +02:00
parent 4747b27f83
commit 446292784c
4 changed files with 84 additions and 7 deletions
+45 -1
View File
@@ -1,11 +1,55 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<SignAssembly>True</SignAssembly>
<BlazorDisableThrowNavigationException>true</BlazorDisableThrowNavigationException>
<UserSecretsId>63d55865-dbfb-40d6-b6df-9bf6d14d15ca</UserSecretsId>
<AssemblyOriginatorKeyFile>..\MidrandBooks.snk</AssemblyOriginatorKeyFile>
<BlazorDisableThrowNavigationException>true</BlazorDisableThrowNavigationException>
</PropertyGroup>
<!-- file nesting -->
<ItemGroup>
<ProjectCapability Include="ConfigurableFileNesting" />
<ProjectCapability Include="ConfigurableFileNestingFeatureEnabled" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="LiteCharms.Features" Version="1.43.0" />
</ItemGroup>
<!-- UI -->
<ItemGroup>
<PackageReference Include="ANM.Blazored.Toast" Version="0.1.1" />
<!-- Global Usings -->
<Using Include="Blazored.Toast.Services" />
</ItemGroup>
<!-- CQRS -->
<ItemGroup>
<PackageReference Include="Mediator.SourceGenerator" Version="3.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<!-- Global Usings -->
<Using Include="FluentResults" />
<Using Include="Mediator" />
<Using Include="Quartz" />
</ItemGroup>
<!-- Health Checks -->
<ItemGroup>
<Using Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" />
</ItemGroup>
<!-- Shared Global Usings -->
<ItemGroup>
<Using Include="Blazored.Toast" />
</ItemGroup>
</Project>
+37 -4
View File
@@ -1,20 +1,53 @@
using LiteCharms.Features.Extensions;
using LiteCharms.Features.Mediator;
using MidrandBookshop.Components;
using static LiteCharms.Features.Extensions.Quartz;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
builder.AddMonitoring();
builder.Services.AddEndpointsApiExplorer();
//builder.Services.AddMediator();
//builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(TelemetryPipelineBehavior<,>));
//builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(LoggingPipelineBehavior<,>));
//builder.Services.AddSalesServiceBus();
//builder.Services.AddGeneralServiceBus();
builder.Services.AddQuartzSchedulerClient(MidrandShopSchedulerName, builder.Configuration);
//builder.Services.AddEmailServices(builder.Configuration);
//builder.Services.AddEmailServiceBus();
builder.Services.AddMidrandShopDatabase(builder.Configuration);
builder.Services.AddMidrandShopPostgresHealthCheck();
//builder.Services.AddMidrandShopQuartzHealthCheck();
builder.Services.AddHealthChecksSupport(builder.Configuration);
var app = builder.Build();
// Configure the HTTP request pipeline.
var schedulerFactory = app.Services.GetRequiredService<ISchedulerFactory>();
var scheduler = await schedulerFactory.GetScheduler(MidrandShopSchedulerName);
if (!scheduler!.IsStarted)
await scheduler.Start();
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error", createScopeForErrors: true);
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHealthChecks("/health", new HealthCheckOptions
{
ResponseWriter = HealthChecks.UI.Client.UIResponseWriter.WriteHealthCheckUIResponse
});
app.UseStatusCodePagesWithReExecute("/not-found", createScopeForStatusCodePages: true);
app.UseHttpsRedirection();
@@ -24,4 +57,4 @@ app.MapStaticAssets();
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
app.Run();
app.Run();