parent
a6e1172f97
commit
764d303543
30 changed files with 93 additions and 265 deletions
|
|
@ -24,7 +24,7 @@ namespace Server.Json
|
|||
{
|
||||
public override IPEndPoint Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
if (IPEndPoint.TryParse(reader.GetString(), out var ipep))
|
||||
if (IPEndPoint.TryParse(reader.GetString()!, out var ipep))
|
||||
{
|
||||
return ipep;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace Server.Json
|
|||
public class TimeSpanConverter : JsonConverter<TimeSpan>
|
||||
{
|
||||
public override TimeSpan Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
=> TimeSpan.Parse(reader.GetString());
|
||||
=> TimeSpan.Parse(reader.GetString()!);
|
||||
|
||||
public override void Write(Utf8JsonWriter writer, TimeSpan value, JsonSerializerOptions options)
|
||||
=> writer.WriteStringValue(value.ToString());
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ namespace Server.Json
|
|||
File.Delete(filePath);
|
||||
}
|
||||
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(filePath));
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(filePath)!);
|
||||
|
||||
File.WriteAllText(filePath, contents);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue