EF DBFirst, the table is removed from the model

Something strange is happening in my EF Database, the first EDMX model. I wanted to update the model after making some changes to the database. The update operation deleted the table that did not receive any changes. This table was present in the model for a long time and never appeared.

Obviously, I get error message 11007: Object type "MyTable" is not displayed.

I have tried several things:

  • Close EDMX without saving, try again: the same problem.
  • Repeat "Update model from the database", check the box in front of the deleted table ... But it is not added to the model (?)
  • Close Visual Studio, try again: same problem.
  • Try another EDMX (I have 5-6 models in the solution, all are connected to the same (large) database): There the table has not been deleted (!)
  • Rename the table in the database: with a new name, it is added.
  • Clear EDMX XML from everything related to this table, repeat the update: no effect.

What can lead to the fact that a specific table will not be added to a specific emdx model file? It seems to me a mistake.

NB. Before deleting the table, it is displayed on the Refresh tab of the Upgrade from Database wizard.

VS 2017 15.4.2 (the latest update was made the day before the problem ??)

EDIT - Additional Information: The table is called "DocumentStatuses" and consists of two columns.

CREATE TABLE [cov].[DocumentStatuses](
    [Id] [int] NOT NULL,
    [Label] [varchar](50) NOT NULL,
CONSTRAINT [PK_DocumentStatus] PRIMARY KEY CLUSTERED ( [Id] ASC )
    WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

DocumentStatus Id . , ( ).

EDIT 2

. edmx , . EDMX , . , . , , 5 , , , 11007.

- , .

3

, ... . EF . , VS, " "?.

.

+4
2

"separator" , 20 . : . _________________________

, "" SSMS. , . ... ! , :

https://github.com/aspnet/EntityFramework6/issues/418

0

"" , . , , .

+1

Source: https://habr.com/ru/post/1688788/


All Articles