Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# core linq savechanges invalid column name error while adding but not while updating

Just to be clear on this answer, because it was most accurate to my situation 
(but I didnt know it until after I figured my problem out). 
  If you have some error related to OtherTable_ID when you are
  retrieving Table, go to your OtherTable model and make sure 
  you don't have an ICollection<Table> in there. Without a relationship 
  defined, the framework will auto-assume that you must have a
  FK to OtherTable and create these extra properties in the generated SQL.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #core #linq #savechanges #invalid #column #error #adding #updating
ADD COMMENT
Topic
Name
2+8 =