We converted the existing database to use EF, so we are writing classes to map to our tables. I added a new column with a null int called iframeVideoId. I matched it with
public int? iframeVideoId { get; set; }
and when I search for this table, it explodes with
invalid column name error
. This is a simple property that is not an index or is associated with some other table. I tried to rename it in the database to " DisplayVideo ", and also make it invalid. Then I had
[Column("DisplayVideo")] public int iframeVideoId { get; set; }
Now I get an error that DisplayVideo is not a valid column. Of course, I double-checked that I was pointing to the correct database, and confirmed that each database that my code MAY indicate indicates this column. I also did a clean and restored everything, and rebooted my machine. What could be wrong? This is the base column, and it is. I know from past experience that if the types do not match (they are both int), I would get an error related to the unsuccessful conversion between types. It makes no sense to me at all. I do not have an edmx file to update because we are writing classes to directly bind to the database
Just to add, I changed the column to a row, and that doesn't make any difference. This is a new column with a simple value, and EF claims it is not.
And I added the column to another table (suboptimal, obviously), and it just worked, right away. I would still like to know why I have a table to which I cannot add columns in EF, although
cgraus
source share