Click here to Skip to main content
15,867,915 members
Home / Discussions / C#
   

C#

 
QuestionQuestion About Async Pin
Kevin Marois29-Sep-21 10:21
professionalKevin Marois29-Sep-21 10:21 
AnswerRe: Question About Async Pin
Pete O'Hanlon29-Sep-21 20:22
subeditorPete O'Hanlon29-Sep-21 20:22 
GeneralRe: Question About Async Pin
Kevin Marois30-Sep-21 4:24
professionalKevin Marois30-Sep-21 4:24 
GeneralRe: Question About Async Pin
Richard Deeming30-Sep-21 4:41
mveRichard Deeming30-Sep-21 4:41 
GeneralRe: Question About Async Pin
Kevin Marois30-Sep-21 4:48
professionalKevin Marois30-Sep-21 4:48 
GeneralRe: Question About Async Pin
Richard Deeming30-Sep-21 5:05
mveRichard Deeming30-Sep-21 5:05 
GeneralRe: Question About Async Pin
Kevin Marois30-Sep-21 5:20
professionalKevin Marois30-Sep-21 5:20 
AnswerRe: Question About Async Pin
Richard Deeming29-Sep-21 21:54
mveRichard Deeming29-Sep-21 21:54 
async is not really about multi-threading; it's about not blocking the current thread waiting for an external resource.

In your example, there are two external resources - the API, and the database.

The front-end call needs to use an async call to the API, since it's a network request which could take a while to run. You don't want your UI thread blocked whilst it's waiting for that request to complete.

The controller methods need to use async calls to the database, since that's potentially another network call, plus disk access, plus the time it takes the DBMS to parse and execute the query.

Think of it like a car trip. In the non-async world, your kids are in the back seat constantly asking "Are we there yet?" over and over again until you arrive. In the async world, your kids sit quietly watching a film on their phone, and wait for you to tell them once you've arrived. One of those options is extremely irritating. Smile | :)



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: Question About Async Pin
Kevin Marois30-Sep-21 4:23
professionalKevin Marois30-Sep-21 4:23 
QuestionMakeGenericType/CreateInstance Object to underlying Type at run-time: why this works is driving me crazy Pin
BillWoodruff28-Sep-21 5:45
professionalBillWoodruff28-Sep-21 5:45 
AnswerRe: MakeGenericType/CreateInstance Object to underlying Type at run-time: why this works is driving me crazy Pin
Richard Deeming28-Sep-21 6:20
mveRichard Deeming28-Sep-21 6:20 
GeneralRe: MakeGenericType/CreateInstance Object to underlying Type at run-time: why this works is driving me crazy Pin
BillWoodruff28-Sep-21 9:47
professionalBillWoodruff28-Sep-21 9:47 
AnswerRe: MakeGenericType/CreateInstance Object to underlying Type at run-time: why this works is driving me crazy Pin
OriginalGriff28-Sep-21 6:30
mveOriginalGriff28-Sep-21 6:30 
GeneralRe: MakeGenericType/CreateInstance Object to underlying Type at run-time: why this works is driving me crazy Pin
BillWoodruff28-Sep-21 10:19
professionalBillWoodruff28-Sep-21 10:19 
GeneralRe: MakeGenericType/CreateInstance Object to underlying Type at run-time: why this works is driving me crazy Pin
OriginalGriff28-Sep-21 10:40
mveOriginalGriff28-Sep-21 10:40 
GeneralRe: MakeGenericType/CreateInstance Object to underlying Type at run-time: why this works is driving me crazy Pin
BillWoodruff29-Sep-21 0:57
professionalBillWoodruff29-Sep-21 0:57 
Questionled matrix display Pin
Member 1537173026-Sep-21 7:49
Member 1537173026-Sep-21 7:49 
AnswerRe: led matrix display Pin
OriginalGriff26-Sep-21 8:33
mveOriginalGriff26-Sep-21 8:33 
QuestionC# 8 nullable reference question / conundrum Pin
Super Lloyd25-Sep-21 1:36
Super Lloyd25-Sep-21 1:36 
QuestionConvering time representation format Pin
Alex Dunlop21-Sep-21 23:26
Alex Dunlop21-Sep-21 23:26 
AnswerRe: Convering time representation format Pin
Peter_in_278022-Sep-21 1:28
professionalPeter_in_278022-Sep-21 1:28 
AnswerRe: Convering time representation format PinPopular
Richard Deeming22-Sep-21 1:37
mveRichard Deeming22-Sep-21 1:37 
AnswerRe: Convering time representation format Pin
BillWoodruff22-Sep-21 22:00
professionalBillWoodruff22-Sep-21 22:00 
AnswerRe: Convering time representation format Pin
Pete O'Hanlon23-Sep-21 2:03
subeditorPete O'Hanlon23-Sep-21 2:03 
GeneralRe: Convering time representation format Pin
Alex Dunlop23-Sep-21 9:22
Alex Dunlop23-Sep-21 9:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.