Update Culture model and DI for non-nullable properties

Refactored Culture model to use required and non-nullable properties.
Removed nullable checks for Info in ShowEnvelope.cshtml.
Changed DI from Cultures to MultiCulture in _ViewImports.cshtml.
This commit is contained in:
2026-02-12 17:16:36 +01:00
parent bcf55f7906
commit 0e270e3182
3 changed files with 13 additions and 8 deletions

View File

@@ -4,15 +4,20 @@ namespace EnvelopeGenerator.Web.Models
{
public class Culture
{
private string _language = string.Empty;
public string Language { get => _language;
init {
private string _language = null!;
public required string Language
{
get => _language;
init
{
_language = value;
Info = new(value);
}
}
public string FIClass { get; init; } = string.Empty;
public CultureInfo? Info { get; init; }
public string FIClass { get; init; } = null!;
public CultureInfo Info { get; init; } = null!;
}
}