예제 #1
0
        private bool PropertyMatch <T>(T c, string ColumnName, string propertyName)
        {
            bool         result       = false;
            PropertyInfo propertyInfo = typeof(T).GetProperty(propertyName);
            ColumnMap    attribute    = ((ColumnMap)GetCustomAttribute(propertyInfo, typeof(ColumnMap)));

            if (attribute != null)
            {
                result = attribute.Name.Equals(ColumnName);
            }
            return(result);
        }
예제 #2
0
        /// <summary>
        /// checks the column name passed to the method matches the field name passed to the method
        /// returns the column name set to lower
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="c"></param>
        /// <param name="ColumnName"></param>
        /// <param name="fieldName"></param>
        private bool FieldMatch <T>(T c, string ColumnName, string fieldName)
        {
            bool      result    = false;
            FieldInfo fieldInfo = typeof(T).GetField(fieldName);
            ColumnMap attribute = ((ColumnMap)GetCustomAttribute(fieldInfo, typeof(ColumnMap)));

            if (attribute != null)
            {
                result = attribute.Name.Equals(ColumnName);
            }
            return(result);
        }