I need to disable the alphabetical order in the code first.
Here is my class simplified
public class Person
{
[Key,Column("PersonId")]
public int Id { get; set; }
[MaxLength(50)]
public string PersonName{ get; set; }
public DateTime? JoinDate{ get; set; }
public int? Gender{ get; set; }
}
and when I run the commands to create the database
dnx ef migrations add InitialMigration
dnx ef database update
The columns of the database, except the primary key, are generated in alphabetical order when I view it in design mode in SQL Server 2012.
How to make it create columns in sequential order as it appears in the class.
I looked on github and could find this question that does not explain how to disable it.
source
share