0
votes

I am trying to update a record in a table using Entity Framework Core in ASP.NET Core MVC, but I am getting an exception while calling

context.SaveChanges() 

saying that record is not there or deleted.

But that record with same id is there in table. I checked it with debugging.

1
Please add what you written to update the record.RK001

1 Answers

0
votes

I am suspecting you are referring to the wrong database.

I have encounter this problem before and the problem is that while I created the connection to the database to generate the model, VS let me choose whether to include the .mdf in the solution and change the connection string.

Please double check your connection string is pointing to the right database.