2014-05-20 1 views
0

비어있을 때 결과가 비어있을 때 나는 Neo4jclient 내부 ArgumentException이 얻을 :경우 ArgumentException이 결과는 다음 쿼리와

graphClient.Cypher 
      .Match("(a:Application {Id: {pId}})") 
      .WithParams(new { pId = request.Id }) 
      .With("a") 
      .OptionalMatch("(a)-[:Uses]->(db:Database)") 
      .ReturnDistinct(db => db.As<DatabaseDto>()); 

결과는 다음과 같습니다

Additional information: Neo4j returned a valid response, however Neo4jClient was unable to deserialize into the object structure you supplied. 

Include this raw JSON, with any sensitive values replaced with non-sensitive equivalents: 


{ 
    "columns" : [ "db" ], 
    "data" : [ [ null ] ] 
} 


Parameter name: content 
    Source=Neo4jClient 
    ParamName=content 
    StackTrace: 
    at Neo4jClient.Serialization.CypherJsonDeserializer`1.Deserialize(String content) in c:\TeamCity\buildAgent\work\5bae2aa9bce99f44\Neo4jClient\Serialization\CypherJsonDeserializer.cs:line 61 
    at Neo4jClient.GraphClient.<>c__DisplayClass1e`1.<Neo4jClient.IRawGraphClient.ExecuteGetCypherResultsAsync>b__1d(Task`1 responseTask) in c:\TeamCity\buildAgent\work\5bae2aa9bce99f44\Neo4jClient\GraphClient.cs:line 820 
    at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() 
    at System.Threading.Tasks.Task.Execute() 
    InnerException: System.InvalidOperationException 
    HResult=-2146233079 
    Message=While trying to map some JSON into an object of type ....DatabaseDto, we failed to find an expected property (Id) in the JSON at path data[0][0]. 

이 토큰에 대한 JSON 블록이었다 :

Source=Neo4jClient 
    StackTrace: 
     at Neo4jClient.Serialization.CommonDeserializerMethods.Map(DeserializationContext context, Object targetObject, JToken parentJsonToken, IEnumerable`1 typeMappings, Int32 nestingLevel) in c:\TeamCity\buildAgent\work\5bae2aa9bce99f44\Neo4jClient\Serialization\CommonDeserializerMethods.cs:line 321 
     at Neo4jClient.Serialization.CommonDeserializerMethods.CreateAndMap(DeserializationContext context, Type type, JToken element, IEnumerable`1 typeMappings, Int32 nestingLevel) in c:\TeamCity\buildAgent\work\5bae2aa9bce99f44\Neo4jClient\Serialization\CommonDeserializerMethods.cs:line 274 
     at Neo4jClient.Serialization.CypherJsonDeserializer`1.<>c__DisplayClass1b.<ParseInSingleColumnMode>b__19(JToken row) in c:\TeamCity\buildAgent\work\5bae2aa9bce99f44\Neo4jClient\Serialization\CypherJsonDeserializer.cs:line 175 
     at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext() 
     at System.Linq.Buffer`1..ctor(IEnumerable`1 source) 
     at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) 
     at Neo4jClient.Serialization.CypherJsonDeserializer`1.Deserialize(String content) in c:\TeamCity\buildAgent\work\5bae2aa9bce99f44\Neo4jClient\Serialization\CypherJsonDeserializer.cs:line 34 
    InnerException: System.InvalidOperationException 
     HResult=-2146233079 
     Message=Cannot access child value on Newtonsoft.Json.Linq.JValue. 
     Source=Newtonsoft.Json 
     StackTrace: 
      at Newtonsoft.Json.Linq.JToken.get_Item(Object key) 
      at Neo4jClient.Serialization.CommonDeserializerMethods.Map(DeserializationContext context, Object targetObject, JToken parentJsonToken, IEnumerable`1 typeMappings, Int32 nestingLevel) in c:\TeamCity\buildAgent\work\5bae2aa9bce99f44\Neo4jClient\Serialization\CommonDeserializerMethods.cs:line 317 
     InnerException: 
+0

Neo4jClient의 버전은 무엇입니까? –

+0

버전 1.0.0.653 – dna

답변

1

정확한 예외를 다시 작성할 수는 없지만 시나리오를 다시 작성하고 발견했습니다. 버그를 일으켰다. 1.0.0.654에서 수정되었습니다.

https://github.com/Readify/Neo4jClient/commit/25b8d3701a0745fbb577e81005da8254c0d67f6f

봅니다 업그레이드. 작동하는 경우이 대답에 동의 함으로 표시하십시오. 그렇지 않다면, 예외가 말하는 것을 수행하고 StackOverflow 대신 여기에서 https://github.com/Readify/Neo4jClient/issues?state=open으로 문제를 제기하십시오.

+0

안녕하세요, 빠른 시일 내에 고맙습니다. 이제 NULL 인 1 요소가있는 Enumerable을 반환합니다. 빈 Enumerable을 반환하는 것이 더 좋지 않습니까? – dna

+0

네, 그게 더 좋을지 모르지만, 그건 네오 4j 그 자체 일 것입니다. 클라이언트 라이브러리로서 저는 응답을 다시 작성해야한다고 생각하지 않습니다. JSON에서 하나의 null 결과가 있다는 것을 알 수 있으므로 .NET에서 반환됩니다. 우리가 빈 열거 형에 그것을 다시 쓴다면 결과로 기대하는 단일 null 행을 반환하는 쿼리가 실제로있을 때 어떤 일이 발생합니까? –

관련 문제