Best Practices for Building Async APIs with ASP.NET Core

  Рет қаралды 83,865

JetBrains

JetBrains

Күн бұрын

Пікірлер: 56
@kuttikrishnankodoth1463
@kuttikrishnankodoth1463 5 жыл бұрын
Kevins materials will always have a guarantee.. Thank you Kevin..!!!
@IchbinChandra
@IchbinChandra 4 жыл бұрын
Where to find more of his materials? Thanks in advance :-)
@kuttikrishnankodoth1463
@kuttikrishnankodoth1463 4 жыл бұрын
@@IchbinChandra subscribe his channel and search for what you looking. Also it’s available in Pluralsight
@IchbinChandra
@IchbinChandra 4 жыл бұрын
Thanks for quick reply 🙂
@PlerbyMcFlerb
@PlerbyMcFlerb 5 жыл бұрын
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.
@mbass77
@mbass77 4 жыл бұрын
Exactly, there is no "leakage", it is a perfectly valid pattern to use, see: blog.stephencleary.com/2016/12/eliding-async-await.html#recommended-guidelines
@racecondition3176
@racecondition3176 4 жыл бұрын
Yep, indeed seems strange..
@vinzzbe
@vinzzbe 4 жыл бұрын
Yeah, Following his good explanation about threads you should idd remove aynsc / await in such cases. There is no need to create a thread which sole purpose is to create another thread.
@albertomorais6720
@albertomorais6720 4 жыл бұрын
What he is referring as "leakage" is the fact the main thread initiates another thread (let's call that "child thread") and then finalizes. That may cause trouble (in his example it does happen). The reason is the main thread opens a dbcontext, then initiates the child thread. Child thread, however, is async and likely releases the control back to to main thread, main thread then finalizes itself and thus disposes dbcontext. However child thread is running, and tries to use dbcontext and get error: "cannot access a disposed object." because that was disposed by the main thread. Solution is, as the author said, use GetBookAsync as async and add await to initiate the child thread.
@RajaKajiev
@RajaKajiev 4 жыл бұрын
@@albertomorais6720 Very good point! Thanks for highlighting this nuance! But I had impression that in presentation the author used it in "leaky abstraction" meaning, which indeed sounds weird, because ... when Task has become a leaky abstraction?
@benleonard237
@benleonard237 5 жыл бұрын
Totally agree. I liked the structure and the flow. Everything was explained to make it easy to understand.
@TanvirAnowar
@TanvirAnowar 5 жыл бұрын
Thank you very much for clarifying the async stuffs and when to use it!
@tom-stein
@tom-stein 5 жыл бұрын
What's the name of the tool mentioned at 1:26:35 ? Can't find it. Something like websqrt?
@CodeSbyAniz
@CodeSbyAniz 4 жыл бұрын
GREAT TUTORIAL AS ALWAYS! This channel is providing so much value. Keep up the good work!
@JetBrainsTV
@JetBrainsTV 4 жыл бұрын
Much appreciated!
@kuroki_suzume
@kuroki_suzume 4 жыл бұрын
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 :)
@umakantverma1884
@umakantverma1884 3 жыл бұрын
very well explained and wonderful tips..
@JetBrainsTV
@JetBrainsTV 3 жыл бұрын
Glad you liked it!
@pubudu313
@pubudu313 4 жыл бұрын
The best async demonstration that I ever see. It was so helpful clearing up certain things when it comes to practical implementation. When to use is answered. Thanks a lot, kevin. all the best!!!
@sridharpatnayak
@sridharpatnayak 5 жыл бұрын
Kevin, Good Stuff and great video, I am a big fan for your videos. I watched your Pluralsight videos. Great.,
@locduonghuu8687
@locduonghuu8687 3 жыл бұрын
Can you share your slide show ? Thanks in advance.
@honestcommenter8424
@honestcommenter8424 4 жыл бұрын
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.
@DanielRodriguez-ds2qs
@DanielRodriguez-ds2qs 2 жыл бұрын
I do agree with the first half of your comment, but I would argue that an empty Guid is not a valid id for a book.
@honestcommenter8424
@honestcommenter8424 2 жыл бұрын
@@DanielRodriguez-ds2qs Why is that? Is it because it is all zeros? What about a guid that is all ones or E's? It is just a value, just like zero for int.
@DanielRodriguez-ds2qs
@DanielRodriguez-ds2qs 2 жыл бұрын
@@honestcommenter8424 Do any implementation (that you are aware of) for creating GUIDs return an empty one?, honest question, to my knowledge the implementations return non-empty non-null values that why I thought empty was illegal.
@honestcommenter8424
@honestcommenter8424 2 жыл бұрын
@@DanielRodriguez-ds2qs Yes!, in theory Guid.NewGuid() could return Guid.Empty.
@benjaminsehic5190
@benjaminsehic5190 4 жыл бұрын
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
@argelpamintuango1956
@argelpamintuango1956 4 жыл бұрын
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
@RajaKajiev
@RajaKajiev 4 жыл бұрын
If you are not a newbie it is now worth spending 1+ hour on this talk IMHO.
@mrnkhlblv
@mrnkhlblv 5 жыл бұрын
But what if controller is marked as async but nothing inside awaiting
@haythamhegab8567
@haythamhegab8567 4 жыл бұрын
Please I would like to download source code for api
@howtospeakamharic7648
@howtospeakamharic7648 4 жыл бұрын
Please increase the font size and use dark theme when presenting
@mr.anderson8987
@mr.anderson8987 5 жыл бұрын
I found this *really* helpful and it answered many question I had beforehand. Thank you very much for sharing.
@BurundukXP
@BurundukXP 4 жыл бұрын
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
@BurundukXP 4 жыл бұрын
I'd recommend this video for better understanding kzbin.info/www/bejne/b6CQqZSqpqehpJY
@WisdomHacks
@WisdomHacks 5 жыл бұрын
Can you share a link to your starter project?
@JetBrainsTV
@JetBrainsTV 5 жыл бұрын
The demo project used throughout the webinar is available on GitHub: github.com/KevinDockx/AspNetCoreAsyncBestPracticesJetBrainsWebinar The other resources are located here: blog.jetbrains.com/dotnet/2019/01/24/best-practices-building-async-apis-asp-net-core-webinar-recording/
@aham-mumukshu-asmi
@aham-mumukshu-asmi 4 жыл бұрын
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!
@SublimeCS
@SublimeCS 3 жыл бұрын
this is amazing content
@entvex
@entvex 4 жыл бұрын
Thanks for a good video :)
@haljohnson6947
@haljohnson6947 2 жыл бұрын
i could make this a very short video... 90 minutes later still watching
@cmugy
@cmugy 6 жыл бұрын
Great stuff
@olegshevchenko655
@olegshevchenko655 5 жыл бұрын
kzbin.info/www/bejne/lYWWnKl3raaDprM&t=2105 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?
@kevinmaaktzin
@kevinmaaktzin 5 жыл бұрын
Hi Oleg, I added an answer to that question to the JetBrains blog: blog.jetbrains.com/dotnet/2019/01/24/best-practices-building-async-apis-asp-net-core-webinar-recording/
@kalprajkakani
@kalprajkakani 5 жыл бұрын
Sound can be better
@kevinrosario9282
@kevinrosario9282 4 жыл бұрын
hi tocayo!
@imteazauck
@imteazauck 5 жыл бұрын
Moves too quickly. Screens jumps too much. a bit difficult to follow.
@tinnetju
@tinnetju 5 жыл бұрын
I am slightly mentally challenged and I had no problem following this guide.
Clean Architecture with ASP.NET Core with Steve "Ardalis" Smith (2020-06-01)
1:50:17
Correcting Common Async/Await Mistakes in .NET - Brandon Minnick
1:00:11
NDC Conferences
Рет қаралды 167 М.
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
Secure a .NET Core API with Bearer Authentication
1:06:56
Les Jackson
Рет қаралды 191 М.
Clean Architecture with ASP.NET Core 2.1 | Jason Taylor
49:20
SSW TV | Videos for developers, by developers
Рет қаралды 309 М.
8 await async mistakes that you SHOULD avoid in .NET
21:13
Nick Chapsas
Рет қаралды 316 М.
Clean ASP.NET Core API using MediatR and CQRS | Setup
22:39
Nick Chapsas
Рет қаралды 325 М.
18-year-old super talent stuns Magnus Carlsen | World Rapid 2024
9:34
ChessBase India
Рет қаралды 76 М.
Clean Architecture with ASP.NET Core 3.0 • Jason Taylor • GOTO 2019
50:47
Turbocharged: Writing High-Performance C# and .NET Code - Steve Gordon
1:01:12
Clean Architecture with ASP.NET Core 3.0  - Jason Taylor - NDC Sydney 2019
1:02:30
The Dome Paradox: A Loophole in Newton's Laws
22:59
Up and Atom
Рет қаралды 777 М.
Clean Architecture with ASP.NET Core 6
29:58
dotnet
Рет қаралды 390 М.