boutique replica bags up ideas

the best replique rolex and prices here.

julia highlight 99j hair color 10a quality straight human hair lace front wigs 8 - 24 inches pre plucked hairline 13x4 inches lace front brazilian wig onlinefor sale

Specify auto-increment Column in the Entity Framework Code First

Updated on     Kisan Patel

Auto-increment column is very useful if we want a unique key for each record in the database table. This is generally treated as primary key and used to select, update, and delete records into the database table.

To specify an auto-increment column in the entity class, the property must be of Integer type (int).

Then you need to use the DatabaseGeneratedAttribute in the following way:

NAMESPACE:

using System.ComponentModel.DataAnnotations.Schema;

CODE:

public class User
{
    [Key]
    [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    public int Id { get; set; }

    ....
    ....
}

Entity Framework

Leave a Reply