Use the attribute "DatabaseGenerated"
Example:
public class Device
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int DeviceId { get; set; }
public string Language { get; set; }
public string RegistrationId { get; set; }
public string DeviceType { get; set; }
public int UserNo { get; set; }
}
Example:
public class Device
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int DeviceId { get; set; }
public string Language { get; set; }
public string RegistrationId { get; set; }
public string DeviceType { get; set; }
public int UserNo { get; set; }
}
No comments:
Post a Comment