Skip to content

Commit

Permalink
style: format code with dotnet-format
Browse files Browse the repository at this point in the history
This commit fixes the style issues introduced in 2174731 according to the output
from dotnet-format.

Details: None
  • Loading branch information
deepsource-autofix[bot] authored Jun 6, 2024
1 parent 2174731 commit a3f8aee
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions Redis/EndPointCollectionJsonConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,23 +315,23 @@ public override void Write(Utf8JsonWriter writer, EndPointCollection value, Jso

public class EndPointSerializerContext(Jso options) : JsonSerializerContext(options)
{
protected override Jso GeneratedSerializerOptions => Options;

public override JsonTypeInfo? GetTypeInfo(type type)
{
return type switch
{
{ Name: nameof(EndPoint) } => CreateJsonTypeInfo(Options),
_ => throw new NotImplementedException()
};
}
}

protected static JsonTypeInfo CreateJsonTypeInfo(Jso jso)
{
var typeInfo = JsonTypeInfo.CreateJsonTypeInfo<EndPoint>(jso);
typeInfo.PolymorphismOptions.DerivedTypes.Add(new JsonDerivedType(typeof(DnsEndPoint)));
typeInfo.PolymorphismOptions.DerivedTypes.Add(new JsonDerivedType(typeof(IPEndPoint)));
return typeInfo;
}
protected override Jso GeneratedSerializerOptions => Options;

public override JsonTypeInfo? GetTypeInfo(type type)
{
return type switch
{
{ Name: nameof(EndPoint) } => CreateJsonTypeInfo(Options),
_ => throw new NotImplementedException()
};
}
}

protected static JsonTypeInfo CreateJsonTypeInfo(Jso jso)
{
var typeInfo = JsonTypeInfo.CreateJsonTypeInfo<EndPoint>(jso);
typeInfo.PolymorphismOptions.DerivedTypes.Add(new JsonDerivedType(typeof(DnsEndPoint)));
typeInfo.PolymorphismOptions.DerivedTypes.Add(new JsonDerivedType(typeof(IPEndPoint)));
return typeInfo;
}
}

0 comments on commit a3f8aee

Please sign in to comment.