You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have ran into the following issue: when I execute query that return result in anonymous object :
var query = this.GraphClient.Cypher
.Match($"(e:{SystemNodeLabelEnum.Product.ToString()} {{AccountId: "{accountId}"}})")
.Return(e => new { SystemNode = e.As<SystemNode>() })
.OrderBy("e.ProductDistributorId")
.Skip(offset)
.Limit(limit);
this query throw exception:
Exception:
Exception has been thrown by the target of an invocation.
Inner exception:
Conversion of ZonedDateTime to INode is not supported.
at Neo4j.Driver.V1.TemporalValue.System.IConvertible.ToType(Type conversionType, IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) in //src/System.Private.CoreLib/shared/System/Convert.cs:line 377
at System.Convert.ChangeType(Object value, Type conversionType) in //src/System.Private.CoreLib/shared/System/Convert.cs:line 315
at Neo4j.Driver.V1.ValueExtensions.As[T](Object value)
at Neo4jClient.StatementResultHelper.Parse[T](IRecord record, String identifier, IGraphClient graphClient)
When i have changed the return type to be the concrete object (not anonymous ) as following:
public class SystemNodeContainer
{
public SystemNode Node { get; set; }
}
the same query execute properly and return the correct result.
var query = this.GraphClient.Cypher
.Match($"(e:{SystemNodeLabelEnum.Product.ToString()} {{AccountId: "{accountId}"}})")
.Return(e => new SystemNodeContainer { SystemNode = e.As<SystemNode>() })
.OrderBy("e.ProductDistributorId")
.Skip(offset)
.Limit(limit);
Could you please advise?
The text was updated successfully, but these errors were encountered:
alexanderIT
changed the title
Map Id and Label from Neo4j to c# poco object.
Return result as anonymous object issue.
Feb 12, 2020
One of the properties in my custom class SystemNode is of type DateTime and in the neo4j database the relevant property is of type datetime and lookes like that : "2020-02-13T09:29:20.4700000"
I have debugged the BoltGraphClient source code and found that when ParseAnonymousAsDynamic method from StatementResultHelper class in client attempt to parse the datetime property from database throw the exception described in the post above.
When i have changed the type of datetime property in the neo4j graph ti string the problem was solved and anonymouse parser work properly.
Could you please advise me what should be the type of datetime property in neo4j database to work properly the deserializer.
Hi ,
I have ran into the following issue: when I execute query that return result in anonymous object :
var query = this.GraphClient.Cypher
.Match($"(e:{SystemNodeLabelEnum.Product.ToString()} {{AccountId: "{accountId}"}})")
.Return(e => new { SystemNode = e.As<SystemNode>() })
.OrderBy("e.ProductDistributorId")
.Skip(offset)
.Limit(limit);
this query throw exception:
Exception:
Exception has been thrown by the target of an invocation.
Inner exception:
Conversion of ZonedDateTime to INode is not supported.
at Neo4j.Driver.V1.TemporalValue.System.IConvertible.ToType(Type conversionType, IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) in //src/System.Private.CoreLib/shared/System/Convert.cs:line 377
at System.Convert.ChangeType(Object value, Type conversionType) in //src/System.Private.CoreLib/shared/System/Convert.cs:line 315
at Neo4j.Driver.V1.ValueExtensions.As[T](Object value)
at Neo4jClient.StatementResultHelper.Parse[T](IRecord record, String identifier, IGraphClient graphClient)
When i have changed the return type to be the concrete object (not anonymous ) as following:
public class SystemNodeContainer
{
public SystemNode Node { get; set; }
}
the same query execute properly and return the correct result.
var query = this.GraphClient.Cypher
.Match($"(e:{SystemNodeLabelEnum.Product.ToString()} {{AccountId: "{accountId}"}})")
.Return(e => new SystemNodeContainer { SystemNode = e.As<SystemNode>() })
.OrderBy("e.ProductDistributorId")
.Skip(offset)
.Limit(limit);
Could you please advise?
The text was updated successfully, but these errors were encountered: