private void SetEntity <T>(T entity, IDataReader reader) { Type type = typeof(T); foreach (MetaParameter param in MetaManager.GetMetaParameters(type)) { object value = reader[param.MappedName]; if (value == DBNull.Value) { value = String.Empty; } type.GetProperty(param.PropertyName).SetValue(entity, value, null); } }