Ejemplo n.º 1
0
        public IEnumerable <Relationship> GetRelationships(RelationshipDirection direction, IEnumerable <string> relationshipTypes)
        {
            string response;
            var    status = Neo4jRestApi.GetRelationshipsOnNode(DbUrl, Id, direction, relationshipTypes, out response);

            if (status != HttpStatusCode.OK)
            {
                throw new Exception(string.Format("Error retrieving relationships on node (node id:{0} http response:{1})", Id, status));
            }

            return(RestRelationshipStore.ParseRelationshipJson(response));
        }
Ejemplo n.º 2
0
        public Relationship CreateRelationship(Node startNode, Node endNode, string relationshipType, Properties properties)
        {
            string response;
            var    status = Neo4jRestApi.CreateRelationship(DbUrl,
                                                            startNode.Id,
                                                            endNode.Id,
                                                            relationshipType,
                                                            properties == null ? null : properties.ToString(),
                                                            out response);

            if (status != HttpStatusCode.Created)
            {
                throw new Exception(string.Format("Error creationg relationship on node (node id:{0} http response:{1})", Id, status));
            }

            return(RestRelationshipStore.ParseRelationshipJson(response).First());
        }