private Column GetColumn(DynamicReference reference)
 {
     if (reference == null)
     {
         return null;
     }
     var table = _schema.FindTable(reference.GetOwner().ToString());
     return table.FindColumn(reference.GetName());
 }
        private Column GetColumn(DynamicReference reference)
        {
            if (reference == null)
            {
                return(null);
            }
            var table = _schema.FindTable(reference.GetOwner().ToString());

            return(table.FindColumn(reference.GetName()));
        }
Example #3
0
        public void PropertyShouldReturnDynamicReference()
        {
            //Arrange
            dynamic table = new DynamicTable("Test", null);

            // Act
            DynamicReference column = table.TestColumn;

            // Assert
            Assert.AreEqual("Test", column.GetOwner().GetName());
            Assert.AreEqual("TestColumn", column.GetName());
        }
        public void GetDynamicPropertyReturnsNewDynamicReferenceWithTableAndColumn()
        {
            // Arrange
            dynamic table = new DynamicReference("Table");

            // Act
            DynamicReference column = table.Column;

            // Assert
            Assert.AreEqual("Column", column.GetName());
            Assert.AreEqual("Table", column.GetOwner().GetName());
        }
Example #5
0
 internal DynamicSchema SetMemberAsSchema(DynamicReference reference)
 {
     if (reference == null) throw new ArgumentNullException("reference");
     _members.TryUpdate(reference.GetName(), new DynamicSchema(reference.GetName(), this), reference);
     return (DynamicSchema)_members[reference.GetName()];
 }
        private static Func<XElement, object> BuildReferenceResolver(DynamicReference reference)
        {
            var resolver = BuildElementResolver(reference);

            return xml => resolver(xml).TryGetAttribute(reference.GetName()).ConvertValue();
        }
        private static Func <XElement, object> BuildReferenceResolver(DynamicReference reference)
        {
            var resolver = BuildElementResolver(reference);

            return(xml => resolver(xml).TryGetAttribute(reference.GetName()).ConvertValue());
        }