UpdateRelationship() public method

public UpdateRelationship ( TransactionalNodeService.Proxy.ServerObjects serviceRelationship ) : void
serviceRelationship TransactionalNodeService.Proxy.ServerObjects
return void
Beispiel #1
0
        public Proxy.IRelationship FindRelationship(ServerObjects.Relationship serviceRelationship)
        {
            Proxy.IRelationship relationship;

            if (ProxyRelationships.ContainsKey(serviceRelationship.RelationshipUid))
            {
                relationship = ProxyRelationships[serviceRelationship.RelationshipUid];

                SoapRelationship soapRelationship = relationship as SoapRelationship;

                /// Not all the relationships that are stored in the RelationshipManager are SoapRelationships, some are FacadeRelationships. In this scenario we want to check if they have an inner SoapRelationship and use that instead.
                if (soapRelationship == null)
                {
                    if (relationship is FacadeRelationship)
                    {
                        FacadeRelationship facadeRelationship = relationship as FacadeRelationship;
                        soapRelationship = facadeRelationship.BaseRelationship as SoapRelationship;
                    }
                }

                if (soapRelationship != null)
                {
                    soapRelationship.UpdateRelationship(serviceRelationship);
                }
            }
            else
            {
                SoapRelationship soapRelationship = new SoapRelationship(MapManager);
                soapRelationship.UpdateRelationship(serviceRelationship);

                ProxyRelationships.Add(soapRelationship.Id, soapRelationship);

                relationship = soapRelationship;
            }

            if (!ServiceRelationships.ContainsKey(serviceRelationship.RelationshipUid))
            {
                ServiceRelationships.Add(serviceRelationship.RelationshipUid, serviceRelationship);
            }

            return(relationship);
        }
        public Proxy.IRelationship FindRelationship(ServerObjects.Relationship serviceRelationship)
        {
            Proxy.IRelationship relationship;

            if (ProxyRelationships.ContainsKey(serviceRelationship.RelationshipUid))
            {
                relationship = ProxyRelationships[serviceRelationship.RelationshipUid];

                SoapRelationship soapRelationship = relationship as SoapRelationship;

                /// Not all the relationships that are stored in the RelationshipManager are SoapRelationships, some are FacadeRelationships. In this scenario we want to check if they have an inner SoapRelationship and use that instead.
                if (soapRelationship == null)
                {
                    if (relationship is FacadeRelationship)
                    {
                        FacadeRelationship facadeRelationship = relationship as FacadeRelationship;
                        soapRelationship = facadeRelationship.BaseRelationship as SoapRelationship;
                    }
                }

                if (soapRelationship != null)
                {
                    soapRelationship.UpdateRelationship(serviceRelationship);
                }
            }
            else
            {
                SoapRelationship soapRelationship = new SoapRelationship(MapManager);
                soapRelationship.UpdateRelationship(serviceRelationship);

                ProxyRelationships.Add(soapRelationship.Id, soapRelationship);

                relationship = soapRelationship;
            }

            if (!ServiceRelationships.ContainsKey(serviceRelationship.RelationshipUid))
            {
                ServiceRelationships.Add(serviceRelationship.RelationshipUid, serviceRelationship);
            }

            return relationship;
        }