error Migrations C # MVC

1

I created a Financial Controller, but when I click on the menu to list it returns the error:

  

Invalid object name 'dbo.Movimentacaos'.

Why did you get this name? It was meant to be Movimentacoes .

PS: I already added in my context to disable pluralization with the code modelBuilder.Conventions.Remove<PluralizingTableNameConvention>(); , but the same error still occurs.

    
asked by anonymous 15.06.2016 / 05:00

1 answer

4
  

Why did you get this name? It was to be Movements

This happens because dbo is schema of SQL Server. You can change this by using the Table attribute in your class.

Ex:

[Table("test.Movimentacoes")]
public class Movimentacao { ... }

The main reason for this error (there is no way to be sure without further details in the question) is that this table does not exist in the database (apparently you are using DatabaseFirst).

    
15.06.2016 / 18:17