ra0o0f / arangoclient.net

ArangoDB .NET Client with LINQ support
Apache License 2.0
99 stars 37 forks source link

JsonProperty attribute is ignored in 0.7.4 #52

Closed PavelPikat closed 8 years ago

PavelPikat commented 8 years ago

I declare my models with JsonProperty attribute like this:

[JsonProperty(NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore)]
public bool? SomeVariable {get; set; }

It worked fine prior 0.7.4 - documents created in the database didn't have fields with nulls. But now all of the fields are created in the database, even if the value is null. It seems like these JsonProperty attributes are ignored.

I tried it with bool? and string and it doesn't work. But it does work with List<T> though

ra0o0f commented 8 years ago

@PavelPikat use Newtonsoft.Json.JsonPropertyAttribute instead of ArangoDB.Client.Common.Newtonsoft.Json.JsonPropertyAttribute

Its because embedded json.net is not being used for the serialization anymore

ra0o0f commented 8 years ago

@PavelPikat i refactored namespace of the embedded json.net so others that has used the embedded attributes get the compile error.

install latest version from nuget

PavelPikat commented 8 years ago

@ra0o0f Thanks for quick response. It works now.