📌  相关文章
📜  c# 属性使字符串成为必需 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:12.328000             🧑  作者: Mango

代码示例1
using System.ComponentModel.DataAnnotations;

{
  [Required(ErrorMessage = "DocumentType is required.")]
  public string DocumentType 
  { 
      get { return _documentType; }
      set { _documentType = value; }
  }
}