Ejemplo n.º 1
0
        public static RequestInsertVertex MakeRequestInsertVertex(String myVertexTypeName, ServiceInsertPayload myPayload)
        {
            RequestInsertVertex Request = new RequestInsertVertex(myVertexTypeName);

            if(!String.IsNullOrEmpty(myPayload.Comment))
                Request.SetComment(myPayload.Comment);

            if(!String.IsNullOrEmpty(myPayload.Edition))
                Request.SetEdition(myPayload.Edition);

            if (myPayload.UUID != null)
                Request.SetUUID(myPayload.UUID.Value);

            if (myPayload.StructuredProperties != null)
            {
                foreach (var toInsert in myPayload.StructuredProperties)
                {
                    Request.AddStructuredProperty(toInsert.PropertyName, toInsert.PropertyValue as IComparable);
                }
            }

            if (myPayload.UnstructuredProperties != null)
            {
                foreach (var toInsert in myPayload.UnstructuredProperties)
                {
                    Request.AddUnstructuredProperty(toInsert.PropertyName, toInsert.PropertyValue);
                }
            }

            if (myPayload.Edges != null)
            {
                foreach (var Edge in myPayload.Edges)
                {
                    Request.AddEdge(Edge.ToEdgePredefinition());
                }
            }

            return Request;
        }
Ejemplo n.º 2
0
 public ServiceVertexInstance Insert(SecurityToken mySecurityToken, Int64 myTransactionToken, String myVertexTypeName,
     ServiceInsertPayload myPayload)
 {
     var Request = ServiceRequestFactory.MakeRequestInsertVertex(myVertexTypeName, myPayload);
     var Response = this.GraphDS.Insert<IVertex>(mySecurityToken, myTransactionToken, Request,
         ServiceReturnConverter.ConvertOnlyVertexInstance);
     return new ServiceVertexInstance(Response);
 }