MyClass my=new MyClass();
也就是给my.GetType().GetProperties()[0].Attributes赋值public class MyClass
{
[ColumnAttribute(IsPK=true)]//这样设置了取出的my.GetType().GetProperties()[0].Attributes为None
public int SID{get;set;}
public string Name{get;set;}
}想问各位大侠,应该怎样给类的属性的Attributes赋值啊?????
也就是给my.GetType().GetProperties()[0].Attributes赋值public class MyClass
{
[ColumnAttribute(IsPK=true)]//这样设置了取出的my.GetType().GetProperties()[0].Attributes为None
public int SID{get;set;}
public string Name{get;set;}
}想问各位大侠,应该怎样给类的属性的Attributes赋值啊?????
MyClass.Name="";
这个意思吗?
在MyClass类的哪个地方设置能让它不为空?
我目前是这么设置的[ColumnAttribute(IsPK=true)]
public int SID{get;set;}但是不管用!我就想问到底应该在MyClass这个类里怎么设置,在哪里设置,才能使我的MyClass的对象
my的my.GetType().GetProperties()[0].Attributes能取道我设置的值???
my
动态添加Attribute倒是做过,Set没有接触过。