What should be the attribute for a Model property that corresponds to the Identity column of the database?

 Posted by Sheonarayan on 11/14/2013 | Category: ASP.NET MVC Interview questions | Views: 4469 | Points: 40

The attribute in the Model field for the Identity column of the database should be DatabaseGenerated(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption.Identity) like below

public int CategoryId { get; set; }


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response