1
我创建了遍历数据从一个重复结构中的主键恢复的方法,但出现以下错误,无法隐式转换类型“System.Attribute”到“布尔”获取主键从数据库
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data.SqlClient;
using System.Linq;
using System.Reflection;
using System.Web;
UPDATE
private void SetSelf(Cliente Entity)
{
foreach (PropertyInfo pro in Entity.GetType().GetProperties())
{
if (this.GetType().GetProperty(pro.Name).GetCustomAttribute(typeof(DataObjectFieldAttribute != null))
this.GetType().GetProperty(pro.Name).SetValue(this, pro.GetValue(Entity));
}
}
我该如何解决这个问题兄弟? – Felipe
可以试试我更新的吗? – zzT
我能解决这个问题,我在typeof亲戚关闭之前放置了不同的null,我放置在亲戚关闭之后,并感谢帮助 – Felipe