- Consolidate decimal.ToFormattedString into Schaad.Accounting.Formatting - Rename EnsureFileExisits -> EnsureFileExists and SplitPredefiniton* -> SplitPredefinition* (class, interface, files, DI reg) - AccountRepository: single-save year-rollover start-balance seed - Drop legacy .NET Standard packages redundant on net9.0 and the stale Interfaces\Extensions\ folder entry - Set culture via RequestLocalizationOptions middleware - Plan: item 9 (unit of work) split off into a dedicated PR D Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
58 lines
1.9 KiB
C#
58 lines
1.9 KiB
C#
using System.Globalization;
|
|
using Microsoft.AspNetCore.Localization;
|
|
using Microsoft.Extensions.Options;
|
|
using Microsoft.FluentUI.AspNetCore.Components;
|
|
using Schaad.Accounting.Datasets;
|
|
using Schaad.Accounting.UI.Components;
|
|
|
|
namespace Schaad.Accounting.UI
|
|
{
|
|
public class Program
|
|
{
|
|
public static void Main(string[] args)
|
|
{
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
// Add services to the container.
|
|
builder.Services.AddRazorComponents()
|
|
.AddInteractiveServerComponents();
|
|
|
|
builder.Services.AddFluentUIComponents();
|
|
|
|
builder.Services.Configure<SettingsDataset>(
|
|
builder.Configuration.GetSection("Settings"));
|
|
builder.Services.AddSingleton(sp =>
|
|
sp.GetRequiredService<IOptions<SettingsDataset>>().Value);
|
|
|
|
builder.Services.AddAccounting();
|
|
|
|
|
|
var app = builder.Build();
|
|
|
|
// Configure the HTTP request pipeline.
|
|
if (!app.Environment.IsDevelopment())
|
|
{
|
|
app.UseExceptionHandler("/Error");
|
|
// 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.UseHttpsRedirection();
|
|
|
|
var supportedCultures = new[] { new CultureInfo("de-CH") };
|
|
app.UseRequestLocalization(new RequestLocalizationOptions
|
|
{
|
|
DefaultRequestCulture = new RequestCulture(supportedCultures[0]),
|
|
SupportedCultures = supportedCultures,
|
|
SupportedUICultures = supportedCultures
|
|
});
|
|
|
|
app.UseAntiforgery();
|
|
app.MapStaticAssets();
|
|
app.MapRazorComponents<App>()
|
|
.AddInteractiveServerRenderMode();
|
|
|
|
app.Run();
|
|
}
|
|
}
|
|
}
|