public void AddChildResponse(FormResponseResource formResponseResource, FormResponseProperties_v2 response)
 {
     response.RootResponseId         = formResponseResource.Id;
     response.RelateParentResponseId = ResponseId;
     ChildFormResponseProperties[response.ResponseId] = response;
     formResponseResource.AddChildResponseIdPath(response);
 }
        public void ChildFormResponsePropertiesTest()
        {
            var childFormResponse_f3r1 = new FormResponseProperties_v2
            {
                FormId     = "f3",
                ResponseId = "f3.r1",
                ChildFormResponseProperties = new Dictionary <string, FormResponseProperties_v2>()
            };

            var childFormResponse_f2r1 = new FormResponseProperties_v2
            {
                FormId     = "f2",
                ResponseId = "f2.r1",
                ChildFormResponseProperties = new Dictionary <string, FormResponseProperties_v2>()
            };

            var childFormResponse_f2r2 = new FormResponseProperties_v2
            {
                FormId     = "f2",
                ResponseId = "f2.r2",
                ChildFormResponseProperties = new Dictionary <string, FormResponseProperties_v2>()
            };

            var childFormResponse_f2r3 = new FormResponseProperties_v2
            {
                FormId     = "f2",
                ResponseId = "f2.r3",
                //ChildFormResponseProperties = new FormResponseProperties_v2[]
                //{
                //    childFormResponse_f3r1,
                //}.ToDictionary(r => r.ResponseId, r => r)
            };

            var childFormResponse_f1r1 = new FormResponseProperties_v2
            {
                RelateParentResponseId = "f0.r1",
                FormId     = "f1",
                ResponseId = "f1.r1",
                //ChildFormResponseProperties = new FormResponseProperties_v2[]
                //{
                //    childFormResponseProperties_f2r1,
                //    childFormResponseProperties_f2r2,
                //    childFormResponseProperties_f2r3
                //}.ToDictionary(r => r.ResponseId, r => r)
            };

            var formResponseResource = new FormResponseResource();
            var rootFormResponse     = new FormResponseProperties_v2
            {
                FormId                 = "root",
                ResponseId             = "f0.r1",
                RelateParentResponseId = null
            };

            formResponseResource.FormResponseProperties = rootFormResponse;

            rootFormResponse.AddChildResponse(response: childFormResponse_f1r1);

            childFormResponse_f1r1.AddChildResponse(formResponseResource, childFormResponse_f2r1);
            childFormResponse_f1r1.AddChildResponse(formResponseResource, childFormResponse_f2r2);
            childFormResponse_f1r1.AddChildResponse(formResponseResource, childFormResponse_f2r3);
        }