Migrations error c# MVC

Asked

Viewed 92 times

1

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

Invalid Object name 'dbo. Move'.

Why did that name stick? It was supposed to be Movimentacoes.

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

  • You can post your Migration.Cs file here?

1 answer

4


Why was that name left? It was to be Moves

This is because dbo is schema SQL Server default. You can change this using the attribute Table 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).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.