Best Practices for Building Async APIs with ASP.NET Core

preview_player
Показать описание
Did you know the main driver for async isn't performance but scalability? Ever wondered why it makes sense to async I/O-bound tasks, but why doing the same with a long-running algorithm can actually hurt scalability? Or why using .Result on a Task in ASP.NET can result in a deadlock but perfectly works in ASP.NET Core - yet you still shouldn't use it? For answers to all of that and more, watch this recorded webinar session on async best practices for ASP.NET Core.

0:06 Intro
2:36 Why write asynchronous code?
15:12 The async/await keywords
20:20 Async return types
26:00 Demo time
42:30 I/O bound vs. computational bound work
57:40 What about legacy code?
1:01:16 What about the synchronization context?
1:22:20 Wrap up and Q&A

About the Presenter:
Kevin Dockx is a freelance solution architect, Pluralsight author & consultant, living in Antwerp (Belgium). These days he's mainly focused on RESTful architectures & security for web applications and mobile applications. He's a Microsoft MVP, and a keen proponent of open-source software.
Рекомендации по теме
Комментарии
Автор

Totally agree. I liked the structure and the flow. Everything was explained to make it easy to understand.

benleonard
Автор

GREAT TUTORIAL AS ALWAYS! This channel is providing so much value. Keep up the good work!

CodeSbyAniz
Автор

Kevin, Good Stuff and great video, I am a big fan for your videos. I watched your Pluralsight videos. Great.,

sridharpatnayak
Автор

at 35:30 you mention "leakage" by not using async/await on the repository. Could you expand on this? I'm struggling to see how this is "leaking implementation details". Seems like a "task" is a prefectly good abstraction regardless of if it originated from an async method or not.

PlerbyMcFlerb
Автор

I found this *really* helpful and it answered many question I had beforehand. Thank you very much for sharing.

mr.anderson
Автор

If you are not a newbie it is now worth spending 1+ hour on this talk IMHO.

RajaKajiev
Автор

Very detailed lesson. Thanks !
P.S. only one remark - it would be nice if you could increase zoom. It was little bit hard to read code :)

kuroki_suzume
Автор

thanks for introducing us the good usage of async and synchronous types. but I'm still curious of how do you implement it when the data you will pull is large that will make the api too long to get it

argelpamintuango
Автор

But what if controller is marked as async but nothing inside awaiting

mrnkhlblv
Автор

Please increase the font size and use dark theme when presenting

howtospeakamharic
Автор

Please I would like to download source code for api

haythamhegab
Автор

At 33:45 you checked if id is Guid.Empty to throw null exception, but that is wrong. If id is null you throw that exception. In fact, Guid.Empty should be valid value, and you shouldn't throw for it even the normal argument exception.

honestcommenter
Автор

i could make this a very short video... 90 minutes later still watching

haljohnson
Автор

You are saying that if we just return the task, we will expose repository implementation (get leaky abstraction).
But from the caller perspective, the is no difference, it even doesn't know if the method is async/await or not, because the caller will operate the interface only.


Could you please explain your point in more detail?

olegshevchenko
Автор

Hmm, a little complex explanation. Could have been more simpler. Lot of lose ends like "dont use async in server" but you showed only one case of 2 Threads being used. I still couldnt understand whats wrong.. Hmm!

thiruvetti
Автор

Thank you very much for clarifying the async stuffs and when to use it!

TanvirAnowar
Автор

Kevins materials will always have a guarantee.. Thank you Kevin..!!!

kuttikrishnankodoth
Автор

Thank you very much for these tips, they were quite helpful and explained my dilemmas around when to use async and where exactly to and no to use it

benjaminsehic
Автор

looks like the author is mixing up "asynchronous execution" and "parallel execution" terms. also mentioning "leakage of your repository" is a bit misleading. I think it comes from the lack of .net async state machine explanation in this presentation (it was just only mentioned without many details...).

BurundukXP
Автор

Can you share your slide show ? Thanks in advance.

locduonghuu