Istudent Rana

Istudent Rana

  • 1.4k
  • 342
  • 84k

Rearrange column in Db after adding new properties in class?

Aug 13 2019 8:40 AM
My application is using EF6 Code First approach.
I have a poco class Employee with three properties Id, Name and Salary
and this class is derived from base class with properties created and modified date.
This class has been already migrated and have table in Db with 5 columbs namely, Id, Name, Salary, CreatedDate and Modified Date.
Now I have to add new properties Enum gender in the Employee class.
While doing so and updating the database new column Gender is created after modified date.
How do i create this new column after Salary ?
 
I added Column Attribute and assign the order number in Employee calss as 0 for Id, 1 for Name, 2 for Salary and 3 for Gender
and run add-migration and update-database command but it did not work.
 

Answers (1)