Exemplo n.º 1
0
        private void AddColumnMappingAttribute(PropertyInfo propInfo)
        {
            var attr = propInfo.GetCustomAttribute(typeof(ColumnMap)) as ColumnMap;

            if (attr != null)
            {
                ColumnMap2Property.Add(attr.ColumnName, propInfo.Name);
            }
        }
Exemplo n.º 2
0
 internal bool HasPropertyOrColumnMapping(string name)
 {
     if (ColumnMap2Property.ContainsKey(name))
     {
         return(true);
     }
     else
     {
         return(PropertyNames.Any(propName => propName == name));
     }
 }
Exemplo n.º 3
0
 internal int GetIndexByPropertyNameOrColumnMapping(string propNameOrColMapName)
 {
     if (ColumnMap2Property.ContainsKey(propNameOrColMapName))
     {
         return(PropertyIndex[ColumnMap2Property[propNameOrColMapName]]);
     }
     else
     {
         return(PropertyIndex[propNameOrColMapName]);
     }
 }
Exemplo n.º 4
0
        internal PropertyInfo GetInfoByPropertyNameOrColumnMapping(string propNameOrColMapName)
        {
            PropertyInfo result = null;

            if (ColumnMap2Property.ContainsKey(propNameOrColMapName))
            {
                result = Properties[PropertyIndex[ColumnMap2Property[propNameOrColMapName]]];
            }
            else
            {
                result = Properties[PropertyIndex[propNameOrColMapName]];
            }
            return(result);
        }