I got below model and i would like to create List when its instantiated.
My question is is there a way i pass only Col1 and Col2 and rowID gets generated automatically, like autoincrement.
Please note, this is not any DB related operation to use Identity column.
public class Class1
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int rowId { get; set; }
public string Col1 { get; set; }
public string Col2 { get; set; }
}
I've tried [Key] and [DatabaseGenerated] (i know DatabaseGenerated may not be right option as the name suggests), but no luck.
Any help is appreciated.
Thank you