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:
@@ -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!;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user