public int AddRelation(int edgeId, int fromNodeId, int toNodeId)
        {
            var edgeIdParam = new SqlParameter()
            {
                ParameterName = "@edgeId",
                Value         = edgeId
            };

            var fromNodeIdParam = new SqlParameter()
            {
                ParameterName = "@fromNodeId",
                Value         = fromNodeId
            };

            var toNodeIdParam = new SqlParameter()
            {
                ParameterName = "@toNodeId",
                Value         = toNodeId
            };

            var result = _spHelper.ExecuteScalar(
                StoredProcedure.CreateEdgeToNodeRelation,
                edgeIdParam,
                fromNodeIdParam,
                toNodeIdParam);

            return((int)(decimal)result);
        }
예제 #2
0
        public int CreateNode(string body)
        {
            var bodyParam = new SqlParameter
            {
                ParameterName = "@body",
                Value         = body
            };

            var result = _spHelper.ExecuteScalar(StoredProcedure.InsertNode, bodyParam);

            return((int)(decimal)result);
        }
예제 #3
0
        public int CreateEdge(string key)
        {
            var keyParam = new SqlParameter()
            {
                ParameterName = "@key",
                Value         = key
            };

            var result = _spHelper.ExecuteScalar(StoredProcedure.InsertEdge, keyParam);

            return((int)(decimal)result);
        }