0
I have a table already created and I want to change the column name without them being deleted, because it already has a lot of information.
I did the procedure of renaming the property Street to Address in class and then executed the command Add-Migration Change-Name-Street-to-Address so the Entity Framework generated a class containing the change that will be made, but I see that there will be a Drop in the Column instead of Rename.
I would like to know what procedure I should do to carry out 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");
}