Skip to content

Commit

Permalink
Remove VertexPropertyPropertiesWrapper and everything concerned with it.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcweber committed Oct 31, 2024
1 parent 4b9af8a commit 928a328
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,6 @@ private sealed class GraphsonJsonSerializer : JsonSerializer
{
private sealed class GremlinContractResolver : DefaultContractResolver
{
private sealed class VertexPropertyPropertiesConverter<T> : JsonConverter<T>
{
public override T? ReadJson(JsonReader reader, Type objectType, T? existingValue, bool hasExistingValue, JsonSerializer serializer)
{
return serializer.Deserialize<VertexPropertyPropertiesWrapper<T>>(reader) is { HasValue: true, Value: { } value }
? value
: default;
}

public override void WriteJson(JsonWriter writer, T? value, JsonSerializer serializer) => throw new NotImplementedException();
}

private readonly IGraphModel _model;

public GremlinContractResolver(IGraphModel model)
Expand All @@ -54,8 +42,6 @@ protected override JsonProperty CreateProperty(MemberInfo member, MemberSerializ
{
if (member.Name == nameof(VertexProperty<object>.Id) || member.Name == nameof(VertexProperty<object>.Label))
property.Writable = true;
else if (member is PropertyInfo { Name: nameof(VertexProperty<object>.Properties) } propertyInfo && !typeof(IDictionary<string, object>).IsAssignableFrom(propertyInfo.PropertyType))
property.Converter = (JsonConverter?)Activator.CreateInstance(typeof(VertexPropertyPropertiesConverter<>).MakeGenericType(propertyInfo.PropertyType));
}
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ public static IGremlinQueryEnvironment UseNewtonsoftJson(this IGremlinQueryEnvir
.ConfigureDeserializer(deserializer => deserializer
.Add(new DeferToNewtonsoftConverterFactory())
.Add(new NewtonsoftJsonSerializerConverterFactory())
.Add(new VertexPropertyPropertiesConverterFactory())
.Add(new DictionaryConverterFactory())
.Add(new DynamicObjectConverterFactory())

Expand Down
18 changes: 0 additions & 18 deletions src/Support.NewtonsoftJson/VertexPropertyPropertiesWrapper.cs

This file was deleted.

0 comments on commit 928a328

Please sign in to comment.