我对以下代码有疑问:
//This class can't be changed for is part of an EF data context.
public partial class person
{
public string Name { get; set; }
}
//I have this partial just to access the person DisplayNameAttribute
[MetadataType(typeof(person_metaData))]
public partial class person
{
}
//And this is the MetaData where i am placing the
public class person_metaData
{
[DisplayName("Name")]
public string Name { get; set; }
}
当它在另一个类中时,我如何获得 DisplayNameAttribute?提前致谢!