asp.net - How do I do an EF Database.ExecuteSQLCommand async? -
Here is the code that I am using:
for work < Async public; IHttpActionResult & gt; NewTopicTests ([FromBody] NewTopicTestsDTO testSpec) {var sql = @ "dbo.sp_new_topic_tests @Chunk"; SqlParameter [] Parameters = New SQLParamator [] {New EscalPramator ("@Chunk", Testspee Chuck)}; Int results = db.Database.ExecuteSqlCommand (SQL, parameter); Wait db.SaveChangesAsync (); Ok OK (); }
Can anyone confirm that this is the correct way to use ASC? Specifically I need to do this:
Full results = db.Database.ExecuteSqlCommand (sql, parameter); Wait db.SaveChangesAsync ();
Note that the code works, but I am having a problem with my application where it stops without any error message. I am looking into every possible problem. / P>
What is being saved here? I think there is no need to make calls to save changes here.
Remove the save changes and you will see the same behavior because any changes you make in your stored procedure are not tracked by the outline of the unit.
And you can rewrite your code as the following:
integer result = wait db.Database.ExecuteSqlCommandAsync (SQL, standards);
Did you find out because of your problem? Windows error logs etc?
Go to the Visual Studio IDE debug menu, and if there is an open exception, then check 'Share language order exception' for both 'throw' and 'user_unhandled' and test your code again.
Comments
Post a Comment