Example #1
0
 public ServiceEdgeType AlterEdgeType(SecurityToken mySecurityToken, Int64 myTransactionToken,
     ServiceEdgeType myEdgeType, ServiceAlterEdgeChangeset myChangeset)
 {
     var Request = ServiceRequestFactory.MakeRequestAlterEdgeType(myEdgeType, myChangeset);
     var Response = this.GraphDS.AlterEdgeType<IEdgeType>(mySecurityToken, myTransactionToken, Request,
        ServiceReturnConverter.ConvertOnlyEdgeType);
     return new ServiceEdgeType(Response);
 }
Example #2
0
        public static RequestAlterEdgeType MakeRequestAlterEdgeType(ServiceEdgeType myEdgeType, ServiceAlterEdgeChangeset myChangeset)
        {
            var Request = new RequestAlterEdgeType(myEdgeType.Name);

            #region Add Attributes

            if (myChangeset.ToBeAddedProperties != null)
            {
                foreach (var toAdd in myChangeset.ToBeAddedProperties)
                {
                    Request.AddProperty(toAdd.ToPropertyPredefinition());
                }
            }

            #endregion

            #region Remove Attributes

            if (myChangeset.ToBeRemovedProperties != null)
            {
                foreach (var toDel in myChangeset.ToBeRemovedProperties)
                {
                    Request.RemoveProperty(toDel);
                }
            }

            #endregion

            #region Rename Task

            if (myChangeset.ToBeRenamedProperties != null)
            {
                foreach(var item in myChangeset.ToBeRenamedProperties)
                {
                    Request.RenameAttribute(item.Key, item.Value);
                }
            }

            #endregion

            if (myChangeset.Comment != null)
                Request.SetComment(myChangeset.Comment);

            if (myChangeset.NewTypeName != null)
                Request.RenameType(myChangeset.NewTypeName);

            //todo add unknown attribute

            return Request;
        }