I have a table already created and I want to change the name of the column without it being deleted, since it already has a lot of information.
I did the procedure to rename the Street to Address property in the class and after I ran the Add-Migration Name-Street-to-Address command, the Entity Framework generated a class containing the change that will be performed, but I see that a Drop in Column will happen instead of Renaming.
I would like to know what procedure I should do to perform this maintenance.
Code below
public override void Up()
{
AddColumn("dbo.Empresas", "Endereco", c => c.String(nullable: false, maxLength: 100));
DropColumn("dbo.Empresas", "Rua");
}
public override void Down()
{
AddColumn("dbo.Empresas", "Rua", c => c.String(nullable: false, maxLength: 100));
DropColumn("dbo.Empresas", "Endereco");
}