Skip to content

Commit

Permalink
Redo converter
Browse files Browse the repository at this point in the history
  • Loading branch information
LucHeart committed Feb 1, 2024
1 parent 350d23e commit c5d7b89
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions API/Utils/OneWayPolymorphicJsonConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ namespace OpenShock.API.Utils;

public class OneWayPolymorphicJsonConverter<G> : JsonConverter<G>
{
public override bool CanConvert(Type typeToConvert) => false;

public override bool CanConvert(Type typeToConvert)
{
return typeof(G) == typeToConvert; //.IsAssignableFrom(typeToConvert);
}

public override G Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) =>
throw new NotSupportedException();

Expand Down

0 comments on commit c5d7b89

Please sign in to comment.