Invalid column name after matching

I added a column (bit \ bool) of IsController to one of my tables

 ALTER TABLE P_USER ADD IsController bit NOT NULL DEFAULT 0 

Updated edmx and added IsController to the MY_USER object, and then changed its name to IsControllerX and matched it to IsController from the table.

And install this inside the solution.domain.business cs file:

  public virtual bool IsControllerX { get; set; } 

In case of debugging, I have an error:

An error occurred while executing the command definition. See internal exception for details. InnerException: Invalid column name 'IsController'.

Error with IsController , not with IsControllerX ! This is the name of the column I'm mapped to - the name of the column inside the database!

Can someone explain why I am getting this error?

+1
source share
1 answer

HOW did you update your model and your generated classes?

In EDMX, you should select the Update Model From Database option in the context menu, and then select the table that has been modified in the update wizard:

enter image description here

Doing this will update your EDMX correctly and it works fine in my script. You did it this way and it still fails? Or did you just do it manually?

+1
source

All Articles