想知道这是否可能或具有这种效果的东西。
public class MyModel
{
public string Name { get; set; }
[Display(Name = String.Format("This is [0]'s phone number", Name)]
public string PhoneNumber { get; set; }
}
我说的是其中包含变量的 DisplayName,它是非静态的,并且可能基于模型的其他属性。这有可能吗?