Linked Questions

137 votes
5 answers
99k views

I came across some best practices for asynchronous programming using c#'s async/await keywords (I'm new to c# 5.0). One of the advices given was the following: Stability: Know your synchronization ...
dror's user avatar
  • 3,956
6 votes
2 answers
6k views

I know that Task.Wait() block thread in which it is executed. Do I understand correctly that Task.WaitAsync() does not do this? I tried to find information about it but I didn't find anything
Daniil Polovina's user avatar
8 votes
1 answer
10k views

First way: var tds=SearchProcess(); await tds; public async Task<XmlElement> SearchProcess() { } Second way: var tds= Task.Factory.StartNew(()=>SearchProcess()); Task.WaitAll(tds); ...
dsaralaya's user avatar
3 votes
1 answer
5k views

I'm communicating with another process via named pipes. The pipe server is implemented in C# and the client is written in C. The server is a WPF application. I need to create a NamedPipeServerStream ...
404's user avatar
  • 8,762
2 votes
1 answer
3k views

I have next part of code : using (var client = new HttpClient()) // from Windows.Web.Http; { //setup client var tokenUri = new Uri(apiBaseUri + "/token"); client.DefaultRequestHeaders....
demo's user avatar
  • 6,295
0 votes
1 answer
1k views

I have a service that calls API GET request and return boolean. Task<bool> LoginExist(string email, string password); In the controller, I have the code below: [HttpPost] public ...
Code Dog's user avatar
1 vote
2 answers
2k views

So I built a small program to consume a REST api, but it never finishes beacuse no data is received. I'm new to using Async and wait commands, so I have probably gotten it wrong somehow. The threads ...
smulan1's user avatar
  • 19
1 vote
0 answers
1k views

I am implementing method for seeding data (and calling it in Startup.Configure() method) which looks like if(!_context.Table.Any()) { _context.Table.Add(); _context.SaveChanges(); } And I want ...
Roomey's user avatar
  • 716
0 votes
2 answers
367 views

This question is different from await vs Task.Wait - Deadlock?. That question deals with a case where (purportedly) await causes a deadlock, and .Wait doesn't. This question is the reverse. ...
Jordan Morris's user avatar
0 votes
0 answers
752 views

Async method (works fine in async code): public async Task<ServiceResult<Config>> GetConfigAsync(string id) { var entity = await _entityRepo.FindAsync(t => t.Id == ...
Mediator's user avatar
  • 15.4k
0 votes
0 answers
216 views

I can't await my task when i load window. I have three viewmodel, with three initialize, and this three initialize have 1 async method to return data from database, and 1 synchronous method. If i try ...
Wieszak's user avatar
0 votes
1 answer
133 views

I am running an await Task< >.Run(() => inside an async method. The code in the await runs to competition but never returns. The next line after the await never gets called. Anyone have any ...
srf's user avatar
  • 41
4 votes
0 answers
114 views

I can't figure out why Task.Delay(1).Wait() does not block the UI thread when called directly, but does when wrapped inside another Task that is then syncrhonously waited on. Take for example this ...
anakic's user avatar
  • 3,028
0 votes
0 answers
71 views

What could possibly be wrong with the following method? The whole app hangs after calling the "await" line... protected async Task<T> PostRequest<T>(string resourceEndpoint, JObject ...
Emilia Tyl's user avatar
0 votes
0 answers
54 views

So i have a bit of a weird things going on. I'm trying to get SendGrid v9 working on my web app. I've run this through a bunch of test, including creating a console app to test. It works great in the ...
Nugs's user avatar
  • 5,893

15 30 50 per page
1
2 3 4 5
8