ENTITY FRAMEWORK - add-migration New Project without renaming old tables

1

I want to share a database with some projects.

I've already done the first project with the bank and it's ok. I copied the project to create a similar one, changed the initial prefix of the Ex tables: project1_client, project2_client and so the problem is happening. When generating the add-migration in the new project it is suggesting renaming the old project tables.

How can I distinctly work add-migration on projects?

    
asked by anonymous 30.03.2016 / 20:57

1 answer

0

Use a TableAttribute [Table("NomeTabela")]

@using System.ComponentModel.DataAnnotations.Schema;

[Table("NomeTabela")]
public class NomeClasse
{
    public int ID { get; set; }

    public string Name { get; set; }    
}

It is responsible for mapping its entity to the table with the specified name.

    
31.03.2016 / 12:49