我想创建一个 ID 值可以从 8000 开始的类,这样它就不会与其他表/模型中的任何其他 ID 冲突。 这是我的模型
public class Employee
{
[Required]
[Range(8000,10000)]
public long Id { get; set; }
[Required]
[DataType(DataType.Text)]
[Display(Name = "First Name")]
public string FirstName { get; set; }
[Required]
[DataType(DataType.Text)]
[Display(Name = "Last Name")]
public string LastName { get; set; }
[Required]
[DataType(DataType.PhoneNumber)]
[Display(Name = "Phone ")]
public string PhoneNumber { get; set; }
public virtual Address Address { get; set; }
[DataType(DataType.EmailAddress)]
[Display(Name = "E-mail")]
public string Email { get; set; }
[DataType(DataType.Date)]
[Display(Name = "Date of Birth", Prompt="MM/DD/YYYY")]
public DateTime dateOfBirth { get; set; }
public virtual IEnumerable<Availability> availability {get;set;}
}