string columnName = propInfo.Name.ToUpper();
if (ht.ContainsKey(columnName) == false)
{
continue;
}
int index = rdr.GetOrdinal(propInfo.Name);
object columnValue = rdr.GetValue(index);
if (columnValue != System.DBNull.Value)
{
SetValue(propInfo, obj, columnValue);
if (string.Compare(columnName, key.ToUpper()) == 0)
{
dictKey = columnValue;
}
}
}
T model = default(T);
model = obj as T;
K objKey = (K)dictKey;
dictModels.Add(objKey, model);
}
}
finally
{
rdr.Close();
rdr.Dispose();
Monitor.Exit(objSync);
}
return dictModels;
}
#endregion
#region internal util
private static Hashtable CreateHashColumnName(IDataReader rdr)
{
int len = rdr.FieldCount;
Hashtable ht = new Hashtable(len);
for (int i = 0; i < len; i++)
{
8/13 首页 上一页 6 7 8 9 10 11 下一页 尾页 |