我有以下型号:
public class DeviceConfigurationModel
{
[Key]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
[Display(Name = "Device Configuration Id")]
public int DeviceConfigurationId { get; set; }
[Required]
[Display(Name = "Device Profile Name")]
[StringLength(50)]
public string ProfileName { get; set; }
[StringLength(50)]
public string SERV { get; set; }
[StringLength(50)]
public string IPAD { get; set; }
public Nullable<int> PORT { get; set; }
[Required]
[Display(Name = "Is Active")]
public bool IsActive { get; set; }
[Required]
[Display(Name = "Date Created")]
public DateTime DateCreated { get; set; } …Run Code Online (Sandbox Code Playgroud)