question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Guid properties cause Deserialization issue using CosmosDB

See original GitHub issue

Describe the bug When using CosmosDB and a Guid property on the Vertex model a deserialization exception is thrown.

Expected behavior Guids and Nullable Guids should work like other types

Version information 8.0.0-preview-0926

Minimal working example

g.AddV(new Tester
                {
                    Id = Guid.NewGuid(),
                    Name = "OwnerTest",
                    Test = Guid.NewGuid(),
                    TenantId = "TenantTest"
                })
                .FirstOrDefaultAsync();

    class Tester : IVertex
    {
        public object? Id { get; set; }
        public string Name { get; set; }
        public string TenantId { get; set; }
        public Guid Test { get; set; }
    }

The exception appears to be thrown because the return object from the call to CosmosDB is a key value pair of {“id”: <Guid>, “value”: <Guid>}

Newtonsoft.Json.JsonSerializationException
Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Guid' because the type requires a JSON primitive value (e.g. string, number, boolean, null) to deserialize correctly.
To fix this error either change the JSON to a JSON primitive value (e.g. string, number, boolean, null) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.
Path '[0].id'.
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
   at ExRam.Gremlinq.Core.GremlinQueryExecutionResultDeserializer.<>c.<.cctor>b__11_0(JToken jToken, Type type, IGremlinQueryEnvironment env, Func`5 overridden, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryExecutionResultDeserializer.cs:line 121
   at lambda_method(Closure , JToken , Type , IGremlinQueryEnvironment , IGremlinQueryFragmentDeserializer )
   at ExRam.Gremlinq.Core.GremlinQueryExecutionResultDeserializer.<>c.<.cctor>b__11_1(JToken jToken, Type type, IGremlinQueryEnvironment env, Func`5 overridden, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryExecutionResultDeserializer.cs:line 147
   at ExRam.Gremlinq.Core.GremlinQueryFragmentDeserializer.GremlinQueryFragmentDeserializerImpl.<>c__DisplayClass4_0`1.<Override>b__0(TSerialized fragment, Type type, IGremlinQueryEnvironment env, Func`5 baseSerializer, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryFragmentDeserializer.cs:line 33
   at lambda_method(Closure , JToken , Type , IGremlinQueryEnvironment , IGremlinQueryFragmentDeserializer )
   at ExRam.Gremlinq.Core.GremlinQueryExecutionResultDeserializer.<>c.<.cctor>b__11_2(JToken jToken, Type type, IGremlinQueryEnvironment env, Func`5 overridden, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryExecutionResultDeserializer.cs:line 151
   at ExRam.Gremlinq.Core.GremlinQueryFragmentDeserializer.GremlinQueryFragmentDeserializerImpl.<>c__DisplayClass4_0`1.<Override>b__0(TSerialized fragment, Type type, IGremlinQueryEnvironment env, Func`5 baseSerializer, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryFragmentDeserializer.cs:line 33
   at lambda_method(Closure , JObject , Type , IGremlinQueryEnvironment , IGremlinQueryFragmentDeserializer )
   at ExRam.Gremlinq.Core.GremlinQueryExecutionResultDeserializer.<>c.<.cctor>b__11_10(JObject jObject, Type type, IGremlinQueryEnvironment env, Func`5 overridden, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryExecutionResultDeserializer.cs:line 248
   at ExRam.Gremlinq.Core.GremlinQueryFragmentDeserializer.GremlinQueryFragmentDeserializerImpl.<>c__DisplayClass4_0`1.<Override>b__0(TSerialized fragment, Type type, IGremlinQueryEnvironment env, Func`5 baseSerializer, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryFragmentDeserializer.cs:line 33
   at lambda_method(Closure , JObject , Type , IGremlinQueryEnvironment , IGremlinQueryFragmentDeserializer )
   at ExRam.Gremlinq.Core.GremlinQueryExecutionResultDeserializer.<>c.<.cctor>b__11_11(JObject jObject, Type type, IGremlinQueryEnvironment env, Func`5 overridden, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryExecutionResultDeserializer.cs:line 261
   at ExRam.Gremlinq.Core.GremlinQueryFragmentDeserializer.GremlinQueryFragmentDeserializerImpl.<>c__DisplayClass4_0`1.<Override>b__0(TSerialized fragment, Type type, IGremlinQueryEnvironment env, Func`5 baseSerializer, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryFragmentDeserializer.cs:line 33
   at lambda_method(Closure , JObject , Type , IGremlinQueryEnvironment , IGremlinQueryFragmentDeserializer )
   at ExRam.Gremlinq.Core.GremlinQueryExecutionResultDeserializer.<>c.<.cctor>b__11_12(JObject jObject, Type type, IGremlinQueryEnvironment env, Func`5 overridden, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryExecutionResultDeserializer.cs:line 268
   at ExRam.Gremlinq.Core.GremlinQueryFragmentDeserializer.GremlinQueryFragmentDeserializerImpl.<>c__DisplayClass4_0`1.<Override>b__0(TSerialized fragment, Type type, IGremlinQueryEnvironment env, Func`5 baseSerializer, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryFragmentDeserializer.cs:line 33
   at lambda_method(Closure , JObject , Type , IGremlinQueryEnvironment , IGremlinQueryFragmentDeserializer )
   at ExRam.Gremlinq.Core.GremlinQueryExecutionResultDeserializer.<>c.<.cctor>b__11_13(JObject jObject, Type type, IGremlinQueryEnvironment env, Func`5 overridden, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryExecutionResultDeserializer.cs:line 273
   at ExRam.Gremlinq.Core.GremlinQueryFragmentDeserializer.GremlinQueryFragmentDeserializerImpl.<>c__DisplayClass4_0`1.<Override>b__0(TSerialized fragment, Type type, IGremlinQueryEnvironment env, Func`5 baseSerializer, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryFragmentDeserializer.cs:line 33
   at lambda_method(Closure , JObject , Type , IGremlinQueryEnvironment , IGremlinQueryFragmentDeserializer )
   at ExRam.Gremlinq.Core.GremlinQueryExecutionResultDeserializer.<>c.<.cctor>b__11_14(JObject jObject, Type type, IGremlinQueryEnvironment env, Func`5 overridden, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryExecutionResultDeserializer.cs:line 305
   at ExRam.Gremlinq.Core.GremlinQueryFragmentDeserializer.GremlinQueryFragmentDeserializerImpl.<>c__DisplayClass4_0`1.<Override>b__0(TSerialized fragment, Type type, IGremlinQueryEnvironment env, Func`5 baseSerializer, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryFragmentDeserializer.cs:line 33
   at lambda_method(Closure , JToken , Type , IGremlinQueryEnvironment , IGremlinQueryFragmentDeserializer )
   at ExRam.Gremlinq.Core.GremlinQueryFragmentDeserializer.GremlinQueryFragmentDeserializerImpl.TryDeserialize[TSerialized](TSerialized serializedData, Type fragmentType, IGremlinQueryEnvironment environment) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryFragmentDeserializer.cs:line 22
   at ExRam.Gremlinq.Core.GremlinQueryExecutionResultDeserializer.<>c.<.cctor>b__11_15(JArray jArray, Type type, IGremlinQueryEnvironment env, Func`5 overridden, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryExecutionResultDeserializer.cs:line 318
   at ExRam.Gremlinq.Core.GremlinQueryFragmentDeserializer.GremlinQueryFragmentDeserializerImpl.<>c__DisplayClass4_0`1.<Override>b__0(TSerialized fragment, Type type, IGremlinQueryEnvironment env, Func`5 baseSerializer, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryFragmentDeserializer.cs:line 33
   at lambda_method(Closure , JArray , Type , IGremlinQueryEnvironment , IGremlinQueryFragmentDeserializer )
   at ExRam.Gremlinq.Core.GremlinQueryExecutionResultDeserializer.<>c.<.cctor>b__11_16(JArray jArray, Type type, IGremlinQueryEnvironment env, Func`5 overridden, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryExecutionResultDeserializer.cs:line 322
   at ExRam.Gremlinq.Core.GremlinQueryFragmentDeserializer.GremlinQueryFragmentDeserializerImpl.<>c__DisplayClass4_0`1.<Override>b__0(TSerialized fragment, Type type, IGremlinQueryEnvironment env, Func`5 baseSerializer, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryFragmentDeserializer.cs:line 33
   at lambda_method(Closure , JArray , Type , IGremlinQueryEnvironment , IGremlinQueryFragmentDeserializer )
   at ExRam.Gremlinq.Core.GremlinQueryExecutionResultDeserializer.<>c.<.cctor>b__11_17(JArray jArray, Type type, IGremlinQueryEnvironment env, Func`5 overridden, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryExecutionResultDeserializer.cs:line 368
   at ExRam.Gremlinq.Core.GremlinQueryFragmentDeserializer.GremlinQueryFragmentDeserializerImpl.<>c__DisplayClass4_0`1.<Override>b__0(TSerialized fragment, Type type, IGremlinQueryEnvironment env, Func`5 baseSerializer, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryFragmentDeserializer.cs:line 33
   at lambda_method(Closure , JToken , Type , IGremlinQueryEnvironment , IGremlinQueryFragmentDeserializer )
   at ExRam.Gremlinq.Core.GremlinQueryFragmentDeserializer.GremlinQueryFragmentDeserializerImpl.TryDeserialize[TSerialized](TSerialized serializedData, Type fragmentType, IGremlinQueryEnvironment environment) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryFragmentDeserializer.cs:line 22
   at ExRam.Gremlinq.Core.GremlinQueryEnvironmentCache.GremlinQueryEnvironmentCacheImpl.GraphsonJsonSerializer.JTokenConverterConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Cache/GremlinQueryEnvironmentCache.cs:line 147
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Populate(JsonReader reader, Object target)
   at Newtonsoft.Json.JsonSerializer.PopulateInternal(JsonReader reader, Object target)
   at Newtonsoft.Json.JsonSerializer.Populate(JsonReader reader, Object target)
   at ExRam.Gremlinq.Core.GremlinQueryExecutionResultDeserializer.<>c.<.cctor>b__11_0(JToken jToken, Type type, IGremlinQueryEnvironment env, Func`5 overridden, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryExecutionResultDeserializer.cs:line 133
   at lambda_method(Closure , JToken , Type , IGremlinQueryEnvironment , IGremlinQueryFragmentDeserializer )
   at ExRam.Gremlinq.Core.GremlinQueryExecutionResultDeserializer.<>c.<.cctor>b__11_1(JToken jToken, Type type, IGremlinQueryEnvironment env, Func`5 overridden, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryExecutionResultDeserializer.cs:line 147
   at ExRam.Gremlinq.Core.GremlinQueryFragmentDeserializer.GremlinQueryFragmentDeserializerImpl.<>c__DisplayClass4_0`1.<Override>b__0(TSerialized fragment, Type type, IGremlinQueryEnvironment env, Func`5 baseSerializer, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryFragmentDeserializer.cs:line 33
   at lambda_method(Closure , JToken , Type , IGremlinQueryEnvironment , IGremlinQueryFragmentDeserializer )
   at ExRam.Gremlinq.Core.GremlinQueryExecutionResultDeserializer.<>c.<.cctor>b__11_2(JToken jToken, Type type, IGremlinQueryEnvironment env, Func`5 overridden, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryExecutionResultDeserializer.cs:line 151
   at ExRam.Gremlinq.Core.GremlinQueryFragmentDeserializer.GremlinQueryFragmentDeserializerImpl.<>c__DisplayClass4_0`1.<Override>b__0(TSerialized fragment, Type type, IGremlinQueryEnvironment env, Func`5 baseSerializer, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryFragmentDeserializer.cs:line 33
   at lambda_method(Closure , JObject , Type , IGremlinQueryEnvironment , IGremlinQueryFragmentDeserializer )
   at ExRam.Gremlinq.Core.GremlinQueryExecutionResultDeserializer.<>c.<.cctor>b__11_10(JObject jObject, Type type, IGremlinQueryEnvironment env, Func`5 overridden, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryExecutionResultDeserializer.cs:line 248
   at ExRam.Gremlinq.Core.GremlinQueryFragmentDeserializer.GremlinQueryFragmentDeserializerImpl.<>c__DisplayClass4_0`1.<Override>b__0(TSerialized fragment, Type type, IGremlinQueryEnvironment env, Func`5 baseSerializer, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryFragmentDeserializer.cs:line 33
   at lambda_method(Closure , JObject , Type , IGremlinQueryEnvironment , IGremlinQueryFragmentDeserializer )
   at ExRam.Gremlinq.Core.GremlinQueryExecutionResultDeserializer.<>c.<.cctor>b__11_11(JObject jObject, Type type, IGremlinQueryEnvironment env, Func`5 overridden, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryExecutionResultDeserializer.cs:line 261
   at ExRam.Gremlinq.Core.GremlinQueryFragmentDeserializer.GremlinQueryFragmentDeserializerImpl.<>c__DisplayClass4_0`1.<Override>b__0(TSerialized fragment, Type type, IGremlinQueryEnvironment env, Func`5 baseSerializer, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryFragmentDeserializer.cs:line 33
   at lambda_method(Closure , JObject , Type , IGremlinQueryEnvironment , IGremlinQueryFragmentDeserializer )
   at ExRam.Gremlinq.Core.GremlinQueryExecutionResultDeserializer.<>c.<.cctor>b__11_12(JObject jObject, Type type, IGremlinQueryEnvironment env, Func`5 overridden, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryExecutionResultDeserializer.cs:line 268
   at ExRam.Gremlinq.Core.GremlinQueryFragmentDeserializer.GremlinQueryFragmentDeserializerImpl.<>c__DisplayClass4_0`1.<Override>b__0(TSerialized fragment, Type type, IGremlinQueryEnvironment env, Func`5 baseSerializer, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryFragmentDeserializer.cs:line 33
   at lambda_method(Closure , JObject , Type , IGremlinQueryEnvironment , IGremlinQueryFragmentDeserializer )
   at ExRam.Gremlinq.Core.GremlinQueryExecutionResultDeserializer.<>c.<.cctor>b__11_13(JObject jObject, Type type, IGremlinQueryEnvironment env, Func`5 overridden, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryExecutionResultDeserializer.cs:line 273
   at ExRam.Gremlinq.Core.GremlinQueryFragmentDeserializer.GremlinQueryFragmentDeserializerImpl.<>c__DisplayClass4_0`1.<Override>b__0(TSerialized fragment, Type type, IGremlinQueryEnvironment env, Func`5 baseSerializer, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryFragmentDeserializer.cs:line 33
   at lambda_method(Closure , JObject , Type , IGremlinQueryEnvironment , IGremlinQueryFragmentDeserializer )
   at ExRam.Gremlinq.Core.GremlinQueryExecutionResultDeserializer.<>c.<.cctor>b__11_14(JObject jObject, Type type, IGremlinQueryEnvironment env, Func`5 overridden, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryExecutionResultDeserializer.cs:line 305
   at ExRam.Gremlinq.Core.GremlinQueryFragmentDeserializer.GremlinQueryFragmentDeserializerImpl.<>c__DisplayClass4_0`1.<Override>b__0(TSerialized fragment, Type type, IGremlinQueryEnvironment env, Func`5 baseSerializer, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryFragmentDeserializer.cs:line 33
   at lambda_method(Closure , JToken , Type , IGremlinQueryEnvironment , IGremlinQueryFragmentDeserializer )
   at ExRam.Gremlinq.Core.GremlinQueryFragmentDeserializer.GremlinQueryFragmentDeserializerImpl.TryDeserialize[TSerialized](TSerialized serializedData, Type fragmentType, IGremlinQueryEnvironment environment) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryFragmentDeserializer.cs:line 22
   at ExRam.Gremlinq.Core.GremlinQueryExecutionResultDeserializer.<>c.<.cctor>b__11_17(JArray jArray, Type type, IGremlinQueryEnvironment env, Func`5 overridden, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryExecutionResultDeserializer.cs:line 349
   at ExRam.Gremlinq.Core.GremlinQueryFragmentDeserializer.GremlinQueryFragmentDeserializerImpl.<>c__DisplayClass4_0`1.<Override>b__0(TSerialized fragment, Type type, IGremlinQueryEnvironment env, Func`5 baseSerializer, IGremlinQueryFragmentDeserializer recurse) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryFragmentDeserializer.cs:line 33
   at lambda_method(Closure , Object , Type , IGremlinQueryEnvironment , IGremlinQueryFragmentDeserializer )
   at ExRam.Gremlinq.Core.GremlinQueryFragmentDeserializer.GremlinQueryFragmentDeserializerImpl.TryDeserialize[TSerialized](TSerialized serializedData, Type fragmentType, IGremlinQueryEnvironment environment) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryFragmentDeserializer.cs:line 22
   at ExRam.Gremlinq.Core.GremlinQueryExecutionResultDeserializer.GremlinQueryExecutionResultDeserializerImpl.Deserialize[TElement](Object executionResult, IGremlinQueryEnvironment environment) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Deserialization/GremlinQueryExecutionResultDeserializer.cs:line 36
   at ExRam.Gremlinq.Core.GremlinQuery`6.<ExRam.Gremlinq.Core.IGremlinQueryBase<TElement>.ToAsyncEnumerable>b__208_0(Object executionResult) in /home/runner/work/ExRam.Gremlinq/ExRam.Gremlinq/ExRam.Gremlinq.Core/Queries/GremlinQuery.explicit.cs:line 232
   at System.Linq.AsyncEnumerable.SelectManyAsyncIterator`2.MoveNextCore() in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/SelectMany.cs:line 463
   at System.Linq.AsyncIteratorBase`1.MoveNextAsync() in /_/Ix.NET/Source/System.Linq.Async/System/Linq/AsyncIterator.cs:line 70
   at System.Linq.AsyncIteratorBase`1.MoveNextAsync() in /_/Ix.NET/Source/System.Linq.Async/System/Linq/AsyncIterator.cs:line 75
   at System.Linq.AsyncEnumerable.<TryGetFirst>g__Core|291_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/FirstOrDefault.cs:line 119
   at System.Linq.AsyncEnumerable.<TryGetFirst>g__Core|291_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/FirstOrDefault.cs:line 121
   at System.Linq.AsyncEnumerable.<FirstOrDefaultAsync>g__Core|287_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/FirstOrDefault.cs:line 32
  • a link to GitHub repository containing a minimal executable project structure that exposes the unexpected behaviour. By ‘minimal’ we mean that you should omit any code that is not directly necessary to show the unexpected behaviour. Make sure you remove any sensible data (e.g. passwords etc). Don’t post tons of business POCOs or DTOs that are not really relevant for exposing the unexpected behaviour.

  • a pull request to ExRam.Gremlinq that adds a failing unit test to the ExRam.Gremlinq tests asserting the expected behaviour. Again, this should be minimal to reduce noise.

In any case: The repro code must be able to checkout and run in the matter of minutes. If the issue contains neither of these things and/or just incomplete code snippets it may be labelled accordingly and become stale. Please understand that I ask for this much effort from you in exchange for my work since it is tedious and time-consuming to isolate the relevant bits from an issue each time just to setup a new project that might not even fail then.

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
matt-psaltiscommented, Aug 26, 2020

I’ll do up a repro as requested. 😃

0reactions
danielcwebercommented, Dec 22, 2020

Yes, the complete correct solution is to not have Guid-properties on vertices and edges. In any other case, the presented workaround is the most correct solution as well. By instructing Gremlinq to treat Guids as database native types, serialization and deserialization will do their best to map values, and it should just work.

But you should go for the string alternative.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enum cannot be serialized as string in CosmosDb #1063
I have an object that I wan't to save as a document in a CosmosDb container. This object contains some Enum properties.
Read more >
System.Text.Json custom serializer for CosmosDb ...
The issue was caused by the class hierarchy. Id was the only field coming from an underlying class, and System.Text.Json requires extra wotk ......
Read more >
Best practices for Azure Cosmos DB .NET SDK
You may run into connectivity/availability issues due to lack of resources on your client machine. Monitor your CPU utilization on nodes running ...
Read more >
Using Azure CosmosDB With .NET Core
CosmosDB uses these to essentially distribute your data across multiple servers for scalability. So two bad examples for you : A GUID ID....
Read more >
Catering for Azure Cosmos DB optimistic concurrency - Codit
We shall start this blog post by understanding what causes a database concurrency issue, the difference between how Transactional Databases ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found