Linq query does not respond after updating Stored Procedure in EntityFramework

0

I'm working with EntityFramework 6 , I have my model created (First DataBase) for quite some time. In my project I have some queries with LINQ and others (to optimize times) made with Stored Procedures (SP).

It worked correctly until I needed to update an existing SP. For my model to notice the change I deleted the 3 files related to the SP.

Then on the model I do the update and I get the SP changes; up to here everything normal. The inconvenience occurs when when executing the website, queries made with LINQ do not return any results; although they have no relationship with the SP or modified tables.

How can I solve this problem? There are no exceptions during execution and if I change the changes in the model the queries with LINQ work correctly.

    
asked by apolyon_inc 20.04.2017 в 17:22
source

2 answers

0

Finally I resolved in the following way:

  • I kept my model updated with the changes in the SP.

  • I deleted the SP from the DB and caused the failure by calling the SP from the website.

  • I recreated the SP in the DB and queries with LINQ and SP They worked correctly.

I really do not know the reasons why it stopped working or why it worked again doing these steps ... but it worked for me!

    
answered by 20.04.2017 / 17:42
source
1

Surely there were differences between the molo saved in VS and the real, remember to update both parts:

From the Entity model editor of Vistual Studio:

  • "Update Model from Database" in any blank part of the editor
  • On our "modelo.TT" we click on "Run custom tool"
  • On our "model.context.TT" we click on "Run custom tool"
  • answered by 22.06.2017 в 17:45