Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for .NET Core #140

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ Neo4jClient.*.nupkg
packages
*.ncrunchsolution
*.Cache
*.vs\
*.vs\
project.lock.json
215 changes: 0 additions & 215 deletions Neo4jClient.Tests/Neo4jClient.Tests.csproj

This file was deleted.

8 changes: 0 additions & 8 deletions Neo4jClient.Tests/packages.config

This file was deleted.

21 changes: 21 additions & 0 deletions Neo4jClient.Tests/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"version": "0.0.0",
"dependencies": {
"Newtonsoft.Json": "8.0.1"
},
"frameworks": {
"dnx451": {
"dependencies": {
"Neo4jClient": "",
"Microsoft.Net.Http": "2.0.20710.0",
"NSubstitute": "1.8.2",
"NUnit": "2.6.2",
"NUnitTestAdapter": "2.0.0"
},

"frameworkAssemblies": {
"System.Drawing": ""
}
}
}
}
2 changes: 1 addition & 1 deletion Neo4jClient/AmbiguousRelationshipDirectionException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Neo4jClient
{
public class AmbiguousRelationshipDirectionException : ApplicationException
public class AmbiguousRelationshipDirectionException : Exception
{
public AmbiguousRelationshipDirectionException()
: base("The direction of the relationship is ambiguous as both node participants are valid as either source, or target nodes. Specify the relationship direction explicitly or ammend the relationship definition to be more restrictive around which node types are allowed as sources and targets.")
Expand Down
1 change: 1 addition & 0 deletions Neo4jClient/ApiModels/Gremlin/GremlinTableCapResponse.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Neo4jClient.Mappers;
using Newtonsoft.Json;

Expand Down
2 changes: 1 addition & 1 deletion Neo4jClient/ApiModels/RootApiResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public Version Version
get
{
if (string.IsNullOrEmpty(neo4j_version))
return new Version();
return new Version(0, 0, 0);

var numericalVersionString = Regex.Replace(
neo4j_version,
Expand Down
11 changes: 6 additions & 5 deletions Neo4jClient/Cypher/CypherFluentQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Newtonsoft.Json.Serialization;
using System.Collections;
using System.Threading.Tasks;
using System.Reflection;

namespace Neo4jClient.Cypher
{
Expand Down Expand Up @@ -75,10 +76,10 @@ public ICypherFluentQuery WithParams(object parameters)
{
if (parameters == null) return this;
var keyValuePairs = new Dictionary<string, object>();
foreach (PropertyDescriptor propertyDescriptor in TypeDescriptor.GetProperties(parameters))
foreach (var propertyInfo in parameters.GetType().GetProperties())
{
var key = propertyDescriptor.Name;
var value = propertyDescriptor.GetValue(parameters);
var key = propertyInfo.Name;
var value = propertyInfo.GetValue(parameters);
keyValuePairs.Add(key, value);
}
return WithParams(keyValuePairs);
Expand Down Expand Up @@ -218,7 +219,7 @@ public ICypherFluentQuery Create(string createText, params object[] objects)
throw new ArgumentException("Array includes a null entry", "objects");

var objectType = o.GetType();
if (objectType.IsGenericType &&
if (objectType.GetTypeInfo().IsGenericType &&
objectType.GetGenericTypeDefinition() == typeof(Node<>))
{
throw new ArgumentException(string.Format(
Expand All @@ -237,7 +238,7 @@ public ICypherFluentQuery Create(string createText, params object[] objects)
public ICypherFluentQuery Create<TNode>(string identity, TNode node)
where TNode : class
{
if (typeof(TNode).IsGenericType &&
if (typeof(TNode).GetTypeInfo().IsGenericType &&
typeof(TNode).GetGenericTypeDefinition() == typeof(Node<>)) {
throw new ArgumentException(string.Format(
"You're trying to pass in a Node<{0}> instance. Just pass the {0} instance instead.",
Expand Down
7 changes: 4 additions & 3 deletions Neo4jClient/Cypher/CypherFluentQuery`Return.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Reflection;
using System.Linq.Expressions;
using Microsoft.SqlServer.Server;
using System.Linq;

namespace Neo4jClient.Cypher
{
Expand All @@ -19,12 +20,12 @@ public ICypherFluentQuery<TResult> Return<TResult>(string identity)
if (identity.Contains(",") && (!identityIsCollection))
throw new ArgumentException(IdentityLooksLikeAMultiColumnStatementExceptionMessage, "identity");

if(identityIsCollection && (typeof(TResult).GetInterface("IEnumerable") == null))
if(identityIsCollection && (typeof(TResult).GetTypeInfo().ImplementedInterfaces.Any(x => x.Name == "IEnumerable")))
throw new ArgumentException(IdentityLooksLikeACollectionButTheResultIsNotEnumerableMessage, "identity");

var resultType = typeof (TResult);

var restFormatNeeded = resultType.IsGenericType && (
var restFormatNeeded = resultType.GetTypeInfo().IsGenericType && (
resultType.GetGenericTypeDefinition() == typeof (Node<>) ||
resultType.GetGenericTypeDefinition() == typeof (RelationshipInstance<>) ||
resultType.GetGenericTypeDefinition() == typeof (Relationship<>));
Expand Down
Loading