I'm using entity framework code first to created database.
i want to add a new field(description) to an exist table after it's [Name] column.
My steps:
1. Exist Table ( Blog ) looks like:
[ID, Name, Url]
2. I want to add [Description] to Blog table after [Name] column, it should to be:
[ID, Name,
Description, Url]
3. Entity framework model class of Blog:
public partial class Blog
{
[Key]
public int ID {get; set;}
public string Name {get; set;}
public string Url {get; set;}
}
4. i add new attribute [Description] in Blog model:
<pre lang="c#">
public partial class Blog
{
[Key]
public int ID {get; set;}
public string Name {get; set;}
public string Description {get; set;}
public string Url {get; set;}
}
5. add migration:
Add-Migration AddDescriptionForBlog
6. update database:
Update-Database
7. look at table, it place [Description] field at last column.
[ID, Name, Url,
Description]
My question:
how can i place [Description] in filed after Name column in the table?