Esempio n. 1
0
        public void One2Many()
        {
            var c2A = new C2Builder(this.DatabaseSession).WithC2AllorsString("c2A").Build();
            var c2B = new C2Builder(this.DatabaseSession).WithC2AllorsString("c2B").Build();
            var c2C = new C2Builder(this.DatabaseSession).WithC2AllorsString("c2C").Build();

            var c1a = new C1Builder(this.DatabaseSession)
                .WithC1AllorsString("c1A")
                .WithC1C2One2Many(c2A)
                .Build();

            var c1b = new C1Builder(this.DatabaseSession)
                .WithC1AllorsString("c1B")
                .WithC1C2One2Many(c2B)
                .WithC1C2One2Many(c2C)
                .Build();

            this.DatabaseSession.Derive(true);

            var path = new Path(C1s.Meta.C1C2One2Manies, C2s.Meta.C2AllorsString);

            var aclMock = new Mock<IAccessControlList>();
            aclMock.Setup(acl => acl.CanRead(It.IsAny<PropertyType>())).Returns(true);
            var acls = new AccessControlListCache(null, (allorsObject, user) => aclMock.Object);

            var result = (ISet<object>)path.Get(c1a, acls);
            Assert.AreEqual(1, result.Count);
            Assert.IsTrue(result.Contains("c2A"));

            result = (ISet<object>)path.Get(c1b, acls);
            Assert.AreEqual(2, result.Count);
            Assert.IsTrue(result.Contains("c2B"));
            Assert.IsTrue(result.Contains("c2C"));
        }
Esempio n. 2
0
        public void One2ManyWithPropertyNames()
        {
            var c2A = new C2Builder(this.Session).WithC2AllorsString("c2A").Build();
            var c2B = new C2Builder(this.Session).WithC2AllorsString("c2B").Build();
            var c2C = new C2Builder(this.Session).WithC2AllorsString("c2C").Build();

            var c1A = new C1Builder(this.Session)
                      .WithC1AllorsString("c1A")
                      .WithC1C2One2Many(c2A)
                      .Build();

            var c1B = new C1Builder(this.Session)
                      .WithC1AllorsString("c1B")
                      .WithC1C2One2Many(c2B)
                      .WithC1C2One2Many(c2C)
                      .Build();

            this.Session.Derive(true);

            Path path;

            Path.TryParse(M.C2.ObjectType, "C1WhereC1C2One2Many", out path);

            var aclMock = new Mock <IAccessControlList>();

            aclMock.Setup(acl => acl.CanRead(It.IsAny <PropertyType>())).Returns(true);
            var acls = new AccessControlListCache(null, (allorsObject, user) => aclMock.Object);

            var result = (C1)path.Get(c2A, acls);

            Assert.AreEqual(result, c1A);

            result = (C1)path.Get(c2B, acls);
            Assert.AreEqual(result, c1B);
        }
Esempio n. 3
0
        public void Resolve()
        {
            var c2A = new C2Builder(this.Session).WithC2AllorsString("c2A").Build();
            var c2B = new C2Builder(this.Session).WithC2AllorsString("c2B").Build();
            var c2C = new C2Builder(this.Session).WithC2AllorsString("c2C").Build();

            var c1A = new C1Builder(this.Session).WithC1AllorsString("c1A").WithC1C2One2Many(c2A).Build();

            var c1B = new C1Builder(this.Session).WithC1AllorsString("c1B")
                      .WithC1C2One2Many(c2B)
                      .WithC1C2One2Many(c2C)
                      .Build();

            this.Session.Derive();

            var tree = new[] { new Node(M.C1.C1C2One2Manies) };

            var resolved = new HashSet <IObject>();

            tree.Resolve(c1A, this.AclsMock.Object, resolved);

            Assert.Single(resolved);
            Assert.Contains(c2A, resolved);

            resolved = new HashSet <IObject>();
            tree.Resolve(c1B, this.AclsMock.Object, resolved);

            Assert.Equal(2, resolved.Count);
            Assert.Contains(c2B, resolved);
            Assert.Contains(c2C, resolved);
        }
Esempio n. 4
0
        public void One2ManyWithPropertyNames()
        {
            var c2A = new C2Builder(this.Session).WithC2AllorsString("c2A").Build();
            var c2B = new C2Builder(this.Session).WithC2AllorsString("c2B").Build();
            var c2C = new C2Builder(this.Session).WithC2AllorsString("c2C").Build();

            var c1A = new C1Builder(this.Session)
                      .WithC1AllorsString("c1A")
                      .WithC1C2One2Many(c2A)
                      .Build();

            var c1B = new C1Builder(this.Session)
                      .WithC1AllorsString("c1B")
                      .WithC1C2One2Many(c2B)
                      .WithC1C2One2Many(c2C)
                      .Build();

            this.Session.Derive();

            Fetch.TryParse(M.C2.ObjectType, "C1WhereC1C2One2Many", out var fetch);

            var result = (C1)fetch.Get(c2A, this.AclsMock.Object);

            Assert.Equal(result, c1A);

            result = (C1)fetch.Get(c2B, this.AclsMock.Object);
            Assert.Equal(result, c1B);
        }
Esempio n. 5
0
        public void One2ManyWithPropertyTypeIds()
        {
            var c2A = new C2Builder(this.Session).WithC2AllorsString("c2A").Build();
            var c2B = new C2Builder(this.Session).WithC2AllorsString("c2B").Build();
            var c2C = new C2Builder(this.Session).WithC2AllorsString("c2C").Build();

            var c1a = new C1Builder(this.Session)
                      .WithC1AllorsString("c1A")
                      .WithC1C2One2Many(c2A)
                      .Build();

            var c1b = new C1Builder(this.Session)
                      .WithC1AllorsString("c1B")
                      .WithC1C2One2Many(c2B)
                      .WithC1C2One2Many(c2C)
                      .Build();

            this.Session.Derive();

            var path = new Fetch(MetaC1.Instance.C1C2One2Manies, MetaC2.Instance.C2AllorsString);

            var result = (ISet <object>)path.Get(c1a, this.AclsMock.Object);

            Assert.Equal(1, result.Count);
            Assert.True(result.Contains("c2A"));

            result = (ISet <object>)path.Get(c1b, this.AclsMock.Object);
            Assert.Equal(2, result.Count);
            Assert.True(result.Contains("c2B"));
            Assert.True(result.Contains("c2C"));
        }
Esempio n. 6
0
        public void Resolve()
        {
            var c2A = new C2Builder(this.Session).WithC2AllorsString("c2A").Build();
            var c2B = new C2Builder(this.Session).WithC2AllorsString("c2B").Build();
            var c2C = new C2Builder(this.Session).WithC2AllorsString("c2C").Build();

            var c1A = new C1Builder(this.Session).WithC1AllorsString("c1A").WithC1C2One2Many(c2A).Build();

            var c1B =
                new C1Builder(this.Session).WithC1AllorsString("c1B")
                .WithC1C2One2Many(c2B)
                .WithC1C2One2Many(c2C)
                .Build();

            this.Session.Derive(true);

            var tree = new Tree(M.C1.ObjectType).Add(M.C1.C1C2One2Manies);

            var resolved = new HashSet <IObject>();

            tree.Resolve(c1A, resolved);

            Assert.Equal(1, resolved.Count);
            Assert.Contains(c2A, resolved);

            resolved = new HashSet <IObject>();
            tree.Resolve(c1B, resolved);

            Assert.Equal(2, resolved.Count);
            Assert.Contains(c2B, resolved);
            Assert.Contains(c2C, resolved);
        }
Esempio n. 7
0
        public void One2ManyWithPropertyNames()
        {
            var c2A = new C2Builder(this.Session).WithC2AllorsString("c2A").Build();
            var c2B = new C2Builder(this.Session).WithC2AllorsString("c2B").Build();
            var c2C = new C2Builder(this.Session).WithC2AllorsString("c2C").Build();

            var c1A = new C1Builder(this.Session)
                .WithC1AllorsString("c1A")
                .WithC1C2One2Many(c2A)
                .Build();

            var c1B = new C1Builder(this.Session)
                .WithC1AllorsString("c1B")
                .WithC1C2One2Many(c2B)
                .WithC1C2One2Many(c2C)
                .Build();

            this.Session.Derive(true);

            Path path;
            Path.TryParse(C2.Meta.ObjectType, "C2One2ManyC1", out path);

            var aclMock = new Mock<IAccessControlList>();
            aclMock.Setup(acl => acl.CanRead(It.IsAny<PropertyType>())).Returns(true);
            var acls = new AccessControlListCache(null, (allorsObject, user) => aclMock.Object);

            var result = (C1)path.Get(c2A, acls);
            Assert.AreEqual(result, c1A);

            result = (C1)path.Get(c2B, acls);
            Assert.AreEqual(result, c1B);
        }
Esempio n. 8
0
        public void ResolveMultipleSubtree()
        {
            var c1A = new C1Builder(this.Session).WithC1AllorsString("c1A").Build();
            var c1B = new C1Builder(this.Session).WithC1AllorsString("c1B").Build();
            var c1C = new C1Builder(this.Session).WithC1AllorsString("c1C").Build();
            var c1D = new C1Builder(this.Session).WithC1AllorsString("c1D").Build();
            var c1E = new C1Builder(this.Session).WithC1AllorsString("c1E").Build();

            var c2A = new C2Builder(this.Session).WithC2AllorsString("c2A").Build();
            var c2B = new C2Builder(this.Session).WithC2AllorsString("c2B").Build();
            var c2C = new C2Builder(this.Session).WithC2AllorsString("c2C").Build();
            var c2D = new C2Builder(this.Session).WithC2AllorsString("c2D").Build();

            c1A.AddC1I12One2Many(c1C);
            c1B.AddC1I12One2Many(c1E);
            c1B.AddC1I12One2Many(c2A);
            c1B.AddC1I12One2Many(c2B);

            c1C.AddC1C1One2Many(c1D);
            c2A.AddC2C2One2Many(c2C);
            c2A.AddC2C2One2Many(c2D);

            this.Session.Derive();

            this.Session.Commit();

            var tree = new[]
            {
                new Node(M.C1.C1I12One2Manies)
                .Add(M.C1.C1C1One2Manies),
                new Node(M.C1.C1I12One2Manies)
                .Add(M.C2.C2C2One2Manies),
            };

            var prefetchPolicy = tree.BuildPrefetchPolicy();

            var resolved = new HashSet <IObject>();

            this.Session.Prefetch(prefetchPolicy, c1A);

            tree.Resolve(c1A, this.AclsMock.Object, resolved);

            Assert.Equal(2, resolved.Count);
            Assert.Contains(c1C, resolved);
            Assert.Contains(c1D, resolved);

            resolved = new HashSet <IObject>();

            this.Session.Prefetch(prefetchPolicy, c1B);
            tree.Resolve(c1B, this.AclsMock.Object, resolved);

            Assert.Equal(5, resolved.Count);
            Assert.Contains(c1E, resolved);
            Assert.Contains(c2A, resolved);
            Assert.Contains(c2B, resolved);
            Assert.Contains(c2C, resolved);
            Assert.Contains(c2D, resolved);
        }
Esempio n. 9
0
        public void ResolveMultipleSubtree()
        {
            var c1A = new C1Builder(this.Session).WithC1AllorsString("c1A").Build();
            var c1B = new C1Builder(this.Session).WithC1AllorsString("c1B").Build();
            var c1C = new C1Builder(this.Session).WithC1AllorsString("c1C").Build();
            var c1D = new C1Builder(this.Session).WithC1AllorsString("c1D").Build();
            var c1E = new C1Builder(this.Session).WithC1AllorsString("c1E").Build();

            var c2A = new C2Builder(this.Session).WithC2AllorsString("c2A").Build();
            var c2B = new C2Builder(this.Session).WithC2AllorsString("c2B").Build();
            var c2C = new C2Builder(this.Session).WithC2AllorsString("c2C").Build();
            var c2D = new C2Builder(this.Session).WithC2AllorsString("c2D").Build();

            c1A.AddC1I12One2Many(c1C);
            c1B.AddC1I12One2Many(c1E);
            c1B.AddC1I12One2Many(c2A);
            c1B.AddC1I12One2Many(c2B);

            c1C.AddC1C1One2Many(c1D);
            c2A.AddC2C2One2Many(c2C);
            c2A.AddC2C2One2Many(c2D);

            this.Session.Derive(true);

            this.Session.Commit();

            var tree =
                new Tree(M.C1.ObjectType)
                .Add(M.C1.C1I12One2Manies,
                     new Tree(M.C1.ObjectType).Add(M.C1.C1C1One2Manies))
                .Add(M.C1.C1I12One2Manies,
                     new Tree(M.C2.ObjectType).Add(M.C2.C2C2One2Manies));

            var prefetchPolicy = tree.BuildPrefetechPolicy();

            var resolved = new HashSet <IObject>();

            this.Session.Prefetch(prefetchPolicy, c1A);
            tree.Resolve(c1A, resolved);

            resolved.Count.ShouldEqual(2);
            resolved.ShouldContain(c1C);
            resolved.ShouldContain(c1D);

            resolved = new HashSet <IObject>();

            this.Session.Prefetch(prefetchPolicy, c1B);
            tree.Resolve(c1B, resolved);

            resolved.Count.ShouldEqual(5);
            resolved.ShouldContain(c1E);
            resolved.ShouldContain(c2A);
            resolved.ShouldContain(c2B);
            resolved.ShouldContain(c2C);
            resolved.ShouldContain(c2D);
        }
Esempio n. 10
0
        public void One2ManyWithPropertyTypeIds()
        {
            var c2A = new C2Builder(this.Session).WithC2AllorsString("c2A").Build();
            var c2B = new C2Builder(this.Session).WithC2AllorsString("c2B").Build();
            var c2C = new C2Builder(this.Session).WithC2AllorsString("c2C").Build();

            var c1a = new C1Builder(this.Session)
                      .WithC1AllorsString("c1A")
                      .WithC1C2One2Many(c2A)
                      .Build();

            var c1b = new C1Builder(this.Session)
                      .WithC1AllorsString("c1B")
                      .WithC1C2One2Many(c2B)
                      .WithC1C2One2Many(c2C)
                      .Build();

            this.Session.Derive(true);

            var path = new Path(MetaC1.Instance.C1C2One2Manies, MetaC2.Instance.C2AllorsString);

            var aclMock = new Mock <IAccessControlList>();

            aclMock.Setup(acl => acl.CanRead(It.IsAny <PropertyType>())).Returns(true);
            var acls = new AccessControlListCache(null, (allorsObject, user) => aclMock.Object);

            var result = (ISet <object>)path.Get(c1a, acls);

            Assert.AreEqual(1, result.Count);
            Assert.IsTrue(result.Contains("c2A"));

            result = (ISet <object>)path.Get(c1b, acls);
            Assert.AreEqual(2, result.Count);
            Assert.IsTrue(result.Contains("c2B"));
            Assert.IsTrue(result.Contains("c2C"));
        }
Esempio n. 11
0
        private void Full()
        {
            var c1A = new C1Builder(session).WithName("c1A").Build();
            var c1B = new C1Builder(session).WithName("c1B").Build();
            var c1C = new C1Builder(session).WithName("c1C").Build();
            var c1D = new C1Builder(session).WithName("c1D").Build();
            var c2A = new C2Builder(session).WithName("c2A").Build();
            var c2B = new C2Builder(session).WithName("c2B").Build();
            var c2C = new C2Builder(session).WithName("c2C").Build();
            var c2D = new C2Builder(session).WithName("c2D").Build();

            #region String
            // class
            c1B.C1AllorsString = "ᴀbra";
            c1C.C1AllorsString = "ᴀbracadabra";
            c1D.C1AllorsString = "ᴀbracadabra";

            c2B.C2AllorsString = "ᴀbra";
            c2C.C2AllorsString = "ᴀbracadabra";
            c2D.C2AllorsString = "ᴀbracadabra";
            // exclusive interface
            c1B.I1AllorsString = "ᴀbra";
            c1C.I1AllorsString = "ᴀbracadabra";
            c1D.I1AllorsString = "ᴀbracadabra";

            // shared interface
            c1B.I12AllorsString = "ᴀbra";
            c1C.I12AllorsString = "ᴀbracadabra";
            c1D.I12AllorsString = "ᴀbracadabra";
            c2B.I12AllorsString = "ᴀbra";
            c2C.I12AllorsString = "ᴀbracadabra";
            c2D.I12AllorsString = "ᴀbracadabra";
            #endregion

            #region Integer
            c1B.C1AllorsInteger = 1;
            c1C.C1AllorsInteger = 2;
            c1D.C1AllorsInteger = 2;

            c1B.I1AllorsInteger = 1;
            c1C.I1AllorsInteger = 2;
            c1D.I1AllorsInteger = 2;

            c1B.I12AllorsInteger = 1;
            c1C.I12AllorsInteger = 2;
            c1D.I12AllorsInteger = 2;
            c2B.I12AllorsInteger = 1;
            c2C.I12AllorsInteger = 2;
            c2D.I12AllorsInteger = 2;
            #endregion

            #region DateTime
            // DateTime
            c1B.C1AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 4, DateTimeKind.Utc);
            c1C.C1AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 5, DateTimeKind.Utc);
            c1D.C1AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 5, DateTimeKind.Utc);

            c1B.I1AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 4, DateTimeKind.Utc);
            c1C.I1AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 5, DateTimeKind.Utc);
            c1D.I1AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 5, DateTimeKind.Utc);

            c1B.I12AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 4, DateTimeKind.Utc);
            c1C.I12AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 5, DateTimeKind.Utc);
            c1D.I12AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 5, DateTimeKind.Utc);
            c2B.I12AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 4, DateTimeKind.Utc);
            c2C.I12AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 5, DateTimeKind.Utc);
            c2D.I12AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 5, DateTimeKind.Utc);
            #endregion

            #region Float
            c1B.C1AllorsDouble = 1;
            c1C.C1AllorsDouble = 2;
            c1D.C1AllorsDouble = 2;

            c1B.I1AllorsDouble = 1;
            c1C.I1AllorsDouble = 2;
            c1D.I1AllorsDouble = 2;

            c1B.I12AllorsDouble = 1;
            c1C.I12AllorsDouble = 2;
            c1D.I12AllorsDouble = 2;
            c2B.I12AllorsDouble = 1;
            c2C.I12AllorsDouble = 2;
            c2D.I12AllorsDouble = 2;
            #endregion

            #region Decimal
            c1B.C1AllorsDecimal = 1;
            c1C.C1AllorsDecimal = 2;
            c1D.C1AllorsDecimal = 2;

            c1B.I1AllorsDecimal = 1;
            c1C.I1AllorsDecimal = 2;
            c1D.I1AllorsDecimal = 2;

            c1B.I12AllorsDecimal = 1;
            c1C.I12AllorsDecimal = 2;
            c1D.I12AllorsDecimal = 2;
            c2B.I12AllorsDecimal = 1;
            c2C.I12AllorsDecimal = 2;
            c2D.I12AllorsDecimal = 2;
            #endregion

            #region One to One
            c1B.C1C1One2One = c1B;
            c1C.C1C1One2One = c1C;
            c1D.C1C1One2One = c1D;

            c1B.C1C2One2One = c2B;
            c1C.C1C2One2One = c2C;
            c1D.C1C2One2One = c2D;

            c1B.I1I2One2One = c2B;
            c1C.I1I2One2One = c2C;
            c1D.I1I2One2One = c2D;

            c1B.I12C2One2One = c2B;
            c1C.I12C2One2One = c2C;
            c1D.I12C2One2One = c2D;
            c2A.I12C2One2One = c2A;

            c1B.C1I12One2One = c1B;
            c1C.C1I12One2One = c2B;
            c1D.C1I12One2One = c2C;
            #endregion

            #region One to Many
            c1B.AddC1C1One2Many(c1B);
            c1C.AddC1C1One2Many(c1C);
            c1C.AddC1C1One2Many(c1D);

            c1B.AddC1C2One2Many(c2B);
            c1C.AddC1C2One2Many(c2C);
            c1C.AddC1C2One2Many(c2D);

            c1B.AddI1I2One2Many(c2B);
            c1C.AddI1I2One2Many(c2C);
            c1C.AddI1I2One2Many(c2D);

            c1B.AddC1I12One2Many(c1B);
            c1C.AddC1I12One2Many(c2C);
            c1C.AddC1I12One2Many(c2D);
            #endregion

            #region Many to One
            c1B.C1C1Many2One = c1B;
            c1C.C1C1Many2One = c1C;
            c1D.C1C1Many2One = c1C;

            c1B.C1C2Many2One = c2B;
            c1C.C1C2Many2One = c2C;
            c1D.C1C2Many2One = c2C;

            c1B.I1I2Many2One = c2B;
            c1C.I1I2Many2One = c2C;
            c1D.I1I2Many2One = c2C;

            c1B.I12C2Many2One = c2B;
            c2C.I12C2Many2One = c2C;
            c2D.I12C2Many2One = c2C;

            c1B.C1I12Many2One = c1B;
            c1C.C1I12Many2One = c2C;
            c1D.C1I12Many2One = c2C;
            #endregion

            #region Many to Many
            c1B.AddC1C1Many2Many(c1B);
            c1C.AddC1C1Many2Many(c1B);
            c1D.AddC1C1Many2Many(c1B);
            c1C.AddC1C1Many2Many(c1C);
            c1D.AddC1C1Many2Many(c1C);
            c1D.AddC1C1Many2Many(c1D);

            c1B.AddC1C2Many2Many(c2B);
            c1C.AddC1C2Many2Many(c2B);
            c1D.AddC1C2Many2Many(c2B);
            c1C.AddC1C2Many2Many(c2C);
            c1D.AddC1C2Many2Many(c2C);
            c1D.AddC1C2Many2Many(c2D);

            c1B.AddI1I2Many2Many(c2B);
            c1C.AddI1I2Many2Many(c2B);
            c1C.AddI1I2Many2Many(c2C);
            c1D.AddI1I2Many2Many(c2B);
            c1D.AddI1I2Many2Many(c2C);
            c1D.AddI1I2Many2Many(c2D);

            c1B.AddI12C2Many2Many(c2B);
            c1C.AddI12C2Many2Many(c2B);
            c1C.AddI12C2Many2Many(c2C);
            c1D.AddI12C2Many2Many(c2B);
            c1D.AddI12C2Many2Many(c2C);
            c1D.AddI12C2Many2Many(c2D);
            c2A.AddI12C2Many2Many(c2A);
            c2A.AddI12C2Many2Many(c2B);
            c2A.AddI12C2Many2Many(c2C);
            c2A.AddI12C2Many2Many(c2D);

            c1B.AddC1I12Many2Many(c1B);
            c1B.AddC1I12Many2Many(c2B);
            c1C.AddC1I12Many2Many(c2B);
            c1C.AddC1I12Many2Many(c2C);
            c1D.AddC1I12Many2Many(c2B);
            c1D.AddC1I12Many2Many(c2C);
            c1D.AddC1I12Many2Many(c2D);
            #endregion
        }
Esempio n. 12
0
        private void Full()
        {
            new PersonBuilder(this.session).WithUserName("noacl").WithFirstName("no").WithLastName("acl").Build();

            var noperm               = new PersonBuilder(this.session).WithUserName("noperm").WithFirstName("no").WithLastName("perm").Build();
            var emptyRole            = new RoleBuilder(this.session).WithName("Empty").Build();
            var defaultSecurityToken = new SecurityTokens(this.session).DefaultSecurityToken;

            var acl = new AccessControlBuilder(this.session).WithRole(emptyRole).WithSubject(noperm).WithSecurityToken(defaultSecurityToken).Build();

            var c1A = new C1Builder(this.session).WithName("c1A").Build();
            var c1B = new C1Builder(this.session).WithName("c1B").Build();
            var c1C = new C1Builder(this.session).WithName("c1C").Build();
            var c1D = new C1Builder(this.session).WithName("c1D").Build();
            var c2A = new C2Builder(this.session).WithName("c2A").Build();
            var c2B = new C2Builder(this.session).WithName("c2B").Build();
            var c2C = new C2Builder(this.session).WithName("c2C").Build();
            var c2D = new C2Builder(this.session).WithName("c2D").Build();

            // class
            c1B.C1AllorsString = "ᴀbra";
            c1C.C1AllorsString = "ᴀbracadabra";
            c1D.C1AllorsString = "ᴀbracadabra";

            c2B.C2AllorsString = "ᴀbra";
            c2C.C2AllorsString = "ᴀbracadabra";
            c2D.C2AllorsString = "ᴀbracadabra";
            // exclusive interface
            c1B.I1AllorsString = "ᴀbra";
            c1C.I1AllorsString = "ᴀbracadabra";
            c1D.I1AllorsString = "ᴀbracadabra";

            // shared interface
            c1B.I12AllorsString = "ᴀbra";
            c1C.I12AllorsString = "ᴀbracadabra";
            c1D.I12AllorsString = "ᴀbracadabra";
            c2B.I12AllorsString = "ᴀbra";
            c2C.I12AllorsString = "ᴀbracadabra";
            c2D.I12AllorsString = "ᴀbracadabra";

            c1B.C1AllorsInteger = 1;
            c1C.C1AllorsInteger = 2;
            c1D.C1AllorsInteger = 2;

            c1B.I1AllorsInteger = 1;
            c1C.I1AllorsInteger = 2;
            c1D.I1AllorsInteger = 2;

            c1B.I12AllorsInteger = 1;
            c1C.I12AllorsInteger = 2;
            c1D.I12AllorsInteger = 2;
            c2B.I12AllorsInteger = 1;
            c2C.I12AllorsInteger = 2;
            c2D.I12AllorsInteger = 2;

            // DateTime
            c1B.C1AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 4, DateTimeKind.Utc);
            c1C.C1AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 5, DateTimeKind.Utc);
            c1D.C1AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 5, DateTimeKind.Utc);

            c1B.I1AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 4, DateTimeKind.Utc);
            c1C.I1AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 5, DateTimeKind.Utc);
            c1D.I1AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 5, DateTimeKind.Utc);

            c1B.I12AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 4, DateTimeKind.Utc);
            c1C.I12AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 5, DateTimeKind.Utc);
            c1D.I12AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 5, DateTimeKind.Utc);
            c2B.I12AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 4, DateTimeKind.Utc);
            c2C.I12AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 5, DateTimeKind.Utc);
            c2D.I12AllorsDateTime = new DateTime(2000, 1, 1, 0, 0, 5, DateTimeKind.Utc);

            c1B.C1AllorsDouble = 1;
            c1C.C1AllorsDouble = 2;
            c1D.C1AllorsDouble = 2;

            c1B.I1AllorsDouble = 1;
            c1C.I1AllorsDouble = 2;
            c1D.I1AllorsDouble = 2;

            c1B.I12AllorsDouble = 1;
            c1C.I12AllorsDouble = 2;
            c1D.I12AllorsDouble = 2;
            c2B.I12AllorsDouble = 1;
            c2C.I12AllorsDouble = 2;
            c2D.I12AllorsDouble = 2;

            c1B.C1AllorsDecimal = 1;
            c1C.C1AllorsDecimal = 2;
            c1D.C1AllorsDecimal = 2;

            c1B.I1AllorsDecimal = 1;
            c1C.I1AllorsDecimal = 2;
            c1D.I1AllorsDecimal = 2;

            c1B.I12AllorsDecimal = 1;
            c1C.I12AllorsDecimal = 2;
            c1D.I12AllorsDecimal = 2;
            c2B.I12AllorsDecimal = 1;
            c2C.I12AllorsDecimal = 2;
            c2D.I12AllorsDecimal = 2;

            c1B.C1C1One2One = c1B;
            c1C.C1C1One2One = c1C;
            c1D.C1C1One2One = c1D;

            c1B.C1C2One2One = c2B;
            c1C.C1C2One2One = c2C;
            c1D.C1C2One2One = c2D;

            c1B.I1I2One2One = c2B;
            c1C.I1I2One2One = c2C;
            c1D.I1I2One2One = c2D;

            c1B.I12C2One2One = c2B;
            c1C.I12C2One2One = c2C;
            c1D.I12C2One2One = c2D;
            c2A.I12C2One2One = c2A;

            c1B.C1I12One2One = c1B;
            c1C.C1I12One2One = c2B;
            c1D.C1I12One2One = c2C;

            c1B.AddC1C1One2Many(c1B);
            c1C.AddC1C1One2Many(c1C);
            c1C.AddC1C1One2Many(c1D);

            c1B.AddC1C2One2Many(c2B);
            c1C.AddC1C2One2Many(c2C);
            c1C.AddC1C2One2Many(c2D);

            c1B.AddI1I2One2Many(c2B);
            c1C.AddI1I2One2Many(c2C);
            c1C.AddI1I2One2Many(c2D);

            c1B.AddC1I12One2Many(c1B);
            c1C.AddC1I12One2Many(c2C);
            c1C.AddC1I12One2Many(c2D);

            c1B.C1C1Many2One = c1B;
            c1C.C1C1Many2One = c1C;
            c1D.C1C1Many2One = c1C;

            c1B.C1C2Many2One = c2B;
            c1C.C1C2Many2One = c2C;
            c1D.C1C2Many2One = c2C;

            c1B.I1I2Many2One = c2B;
            c1C.I1I2Many2One = c2C;
            c1D.I1I2Many2One = c2C;

            c1B.I12C2Many2One = c2B;
            c2C.I12C2Many2One = c2C;
            c2D.I12C2Many2One = c2C;

            c1B.C1I12Many2One = c1B;
            c1C.C1I12Many2One = c2C;
            c1D.C1I12Many2One = c2C;

            c1B.AddC1C1Many2Many(c1B);
            c1C.AddC1C1Many2Many(c1B);
            c1D.AddC1C1Many2Many(c1B);
            c1C.AddC1C1Many2Many(c1C);
            c1D.AddC1C1Many2Many(c1C);
            c1D.AddC1C1Many2Many(c1D);

            c1B.AddC1C2Many2Many(c2B);
            c1C.AddC1C2Many2Many(c2B);
            c1D.AddC1C2Many2Many(c2B);
            c1C.AddC1C2Many2Many(c2C);
            c1D.AddC1C2Many2Many(c2C);
            c1D.AddC1C2Many2Many(c2D);

            c1B.AddI1I2Many2Many(c2B);
            c1C.AddI1I2Many2Many(c2B);
            c1C.AddI1I2Many2Many(c2C);
            c1D.AddI1I2Many2Many(c2B);
            c1D.AddI1I2Many2Many(c2C);
            c1D.AddI1I2Many2Many(c2D);

            c1B.AddI12C2Many2Many(c2B);
            c1C.AddI12C2Many2Many(c2B);
            c1C.AddI12C2Many2Many(c2C);
            c1D.AddI12C2Many2Many(c2B);
            c1D.AddI12C2Many2Many(c2C);
            c1D.AddI12C2Many2Many(c2D);
            c2A.AddI12C2Many2Many(c2A);
            c2A.AddI12C2Many2Many(c2B);
            c2A.AddI12C2Many2Many(c2C);
            c2A.AddI12C2Many2Many(c2D);

            c1B.AddC1I12Many2Many(c1B);
            c1B.AddC1I12Many2Many(c2B);
            c1C.AddC1I12Many2Many(c2B);
            c1C.AddC1I12Many2Many(c2C);
            c1D.AddC1I12Many2Many(c2B);
            c1D.AddC1I12Many2Many(c2C);
            c1D.AddC1I12Many2Many(c2D);
        }