Code First model missing tables

685 Views Asked by At

I have an existing database with many tables that I am creating a Code First model from. When I create the model, it is missing several tables that are in the database.

Steps taken

  1. Using the Entity Data Wizard, select Code First from database.

  2. Select the connection string for my localhost (which is already being used for a different context that working and is suffering the same issue).

  3. Select the tables I want to include in the model. Here I have one table that works, and one that does not (PPF_Users and PPF_Transactions). Entity Data Model Wizard

  4. Finish the wizard.

The result is that the new context is creatd, but it only has the DbSet PPF_Users, and the model for PPF_User is created.

The is no model for PPF_Transactions and its DbSet is not the context.

There is also an existing context using the same connection string. I attempted to use the Reverse Engineer Code First tool from Entity Framework Power Tools Beta 4, but it did not generate the models for the PPF_Transactions table.

Table structure

CREATE TABLE [dbo].[PPF_Transactions](
[BranchId] [uniqueidentifier] NULL,
[CustomerId] [uniqueidentifier] NULL,
[LoanNbr] [numeric](18, 0) NULL,
[TransSeqNbr] [numeric](18, 0) NULL,
[TransCd] [varchar](20) NULL,
[TransDesc] [varchar](200) NULL,
[TransAmt] [numeric](18, 2) NULL,
[TransEffectiveDt] [datetime] NULL,
[TransEnteredDt] [datetime] NULL,
[Product] [varchar](200) NULL
0

There are 0 best solutions below