refactor(ClientOptions): Vereinfachung der Initialisierung von JsonSerializerOptions
- Null-Prüfung und verzögerte Initialisierung von JsonSerializerOptions entfernt - Standard-JsonSerializerOptions mit PropertyNameCaseInsensitive = true festgelegt - DateTimeConverter immer hinzufügen, wenn JsonSerializerDateFormat festgelegt ist
This commit is contained in:
parent
1ed1937c40
commit
e85a4986e6
@ -22,11 +22,13 @@ public class ClientOptions
|
||||
_jsonSerializerDateFormat = value;
|
||||
if (value is not null)
|
||||
{
|
||||
JsonSerializerOptions ??= new JsonSerializerOptions();
|
||||
JsonSerializerOptions.Converters.Add(new DateTimeConverter(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public JsonSerializerOptions? JsonSerializerOptions { get; set; }
|
||||
public JsonSerializerOptions JsonSerializerOptions { get; set; } = new()
|
||||
{
|
||||
PropertyNameCaseInsensitive = true
|
||||
};
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user