コード例 #1
0
        public void ToExpando_FromOneAnonymousType()
        {
            var o = DS.Expando(
                new { ID = 1, Name = "Fred" }
                );

            Assert.AreEqual(1, o.ID);
            Assert.AreEqual("Fred", o.Name);
        }
コード例 #2
0
        public void ToExpando_OneObject2PropertiesDefinedAsString()
        {
            var o = DS.Expando(
                "ID", 1,
                "Name", "Fred"
                );

            Assert.AreEqual(1, o.ID);
            Assert.AreEqual("Fred", o.Name);
        }
コード例 #3
0
        public void ToExpando_FromTwoAnonymousType()
        {
            var o = DS.Expando(
                new { ID = 1, Name = "Fred" },
                new { Age = 45, Country = "FR" }
                );

            Assert.AreEqual(1, o.ID);
            Assert.AreEqual("Fred", o.Name);
            Assert.AreEqual(45, o.Age);
            Assert.AreEqual("FR", o.Country);
        }