Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Expectation Failed

NeidennXNeidennX Member ✭✭✭

Ok so i have this app that is running a code to insert some data in a SQL Table with the API, but with that same click i need to actually insert into two tables at the same time, so i created a thread for the insert on the second table, the thing is that, when the app compiles is throwing an error saying Expectation Failed

This is the full method:

The error is in the highlighted area

and this is the exception:

Answers

  • TedRogersTedRogers USMember ✭✭✭✭

    @NeidennX You shouldn't need to spin up another thread. The requests will get processed asynchronously by HttpClient. In your case you could create the two tasks and then wait on them both to be completed. Create the tasks put them in an array and call "await Task.WaitAll(myTaskArray);"

Sign In or Register to comment.