Пример #1
0
        public IEnumerable <ScriptedPatchCommandData> Establish(InnovationProfile edge1Profile, UserProfile edgeNProfile)
        {
            Relation edge1 = new HasCaseManager(edgeNProfile);
            Relation edgeN = new CaseManagerOf(edge1Profile);

            yield return(new ScriptedPatchCommandData
            {
                Key = edge1Profile.Id,
                Patch = new ScriptedPatchRequest
                {
                    Script = "addRelation(relationClrType, relation);",
                    Values = new Dictionary <string, object>
                    {
                        { "relation", edge1 },
                        { "relationClrType", ClrType(edge1.GetType()) },
                        { "otherSideRelationType", edgeN.Type },
                        { "otherSideRelationSubType", edgeN.SubType }
                    }
                }
            });

            yield return(new ScriptedPatchCommandData
            {
                Key = edgeNProfile.Id,
                Patch = new ScriptedPatchRequest
                {
                    Script = "addRelation(relationClrType, relation);",
                    Values = new Dictionary <string, object>
                    {
                        { "relation", edgeN },
                        { "relationClrType", ClrType(edgeN.GetType()) }
                    }
                }
            });
        }
Пример #2
0
        public IEnumerable <PatchCommandData> Establish(InnovationProfile edge1Profile, UserProfile edgeNProfile)
        {
            Relation edge1 = new HasCaseManager(edgeNProfile);
            Relation edgeN = new CaseManagerOf(edge1Profile);

            yield return(new PatchCommandData(edge1Profile.Id, null, new PatchRequest
            {
                Script = "addRelation(args.relationClrType, args.relation);",
                Values = new Dictionary <string, object>
                {
                    { "relation", edge1 },
                    { "relationClrType", edge1.GetType().AssemblyQualifiedName },
                    { "otherSideRelationType", edgeN.Type },
                    { "otherSideRelationSubType", edgeN.SubType }
                }
            }, null));

            yield return(new PatchCommandData(edgeNProfile.Id, null, new PatchRequest
            {
                Script = "addRelation(args.relationClrType, args.relation);",
                Values = new Dictionary <string, object>
                {
                    { "relation", edgeN },
                    { "relationClrType", edgeN.GetType().AssemblyQualifiedName }
                }
            }, null));
        }