IAsyncEnumerable, My Favorite C# 8 Feature That No One Is Using

  Рет қаралды 26,316

Amichai Mantinband

Amichai Mantinband

Күн бұрын

Пікірлер: 51
@amantinband
@amantinband 2 жыл бұрын
Hope you enjoyed the video! Small correction (9:18), ForEachAsync doesn't "materialize" the IAsyncEnumerable. It iterates over it, similar to the await foreach we wrote earlier. Here is the underlying source code: github.com/dotnet/reactive/blob/85f1eb7c53e27cccdbeee3e0b044916168843fcc/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ForEach.cs#L30
@MilanJovanovicTech
@MilanJovanovicTech 2 жыл бұрын
System.Linq.Async? I learned something new 😁
@amantinband
@amantinband 2 жыл бұрын
Yeah it’s pretty sweet 😎
@JDevCode
@JDevCode 2 жыл бұрын
Are the 2 best channels on KZbin, I learned so much with both. Goats
@jamesmussett
@jamesmussett 2 жыл бұрын
Im lucky enough to use it on a daily basis. Extremely useful when working with sensors, networking, or any kind of real time streaming where the data being returned can potentially be infinite. Great video 👍 keep it up!
@amantinband
@amantinband 2 жыл бұрын
Sounds interesting 👀
@Misteribel
@Misteribel 3 ай бұрын
Great explanation. For F# programmers, consider using the 'TaskSeq' Nuget Lib, which brings 'await foreach' to F# using Computation Expressions like 'task {...}' and 'seq{...}'.
@Linkario86
@Linkario86 Жыл бұрын
Amichai, I'm so glad I found your channel. You're the GOAT
@charlesstacyharrisiii2593
@charlesstacyharrisiii2593 Жыл бұрын
Nicely done! I love the way you explain things. You're a natural teacher!
@Osirus1156
@Osirus1156 Жыл бұрын
I agree with your opinion on why it wasn't more widely accepted. I used it quite a bit on a project and we ended up needing to write helper methods just to work with them when those helpers could have just been built in. I am hoping someday Microsoft gives it another pass to consolidate it. It is very nice when calling paged APIs though.
@egtdig4411
@egtdig4411 2 жыл бұрын
Hey, first time viewer of the channel. Thumbs up for the short & informative video, liked it very much. Could you please share what kind of skin are you using for your terminal? It seems very useful.
@amantinband
@amantinband Жыл бұрын
Thanks! You can follow this step by step: www.hanselman.com/blog/my-ultimate-powershell-prompt-with-oh-my-posh-and-the-windows-terminal
@alexlo2621
@alexlo2621 2 жыл бұрын
Thank u for the video. I want to suggest another topic related to DDD/Design/Architecture. Could u post a video about anemic code/design? Cons and pros. Thank u.
@amantinband
@amantinband Жыл бұрын
That's a great topic. I'll see if I can create a compelling video. Are you following @codeopinion? He covers this topic in a few different videos, I think
@mlhtest5928
@mlhtest5928 Жыл бұрын
How do you get IAsyncEnumerable to work in an api contoller or minimal api? No matter what I try it still buffers the responses and sends them all at one time. Thanks
@nayanchoudhary4353
@nayanchoudhary4353 2 жыл бұрын
I just used it today and was wondering about cancellationtoken usage. And just saw your video!Great timing! 🙂 I see you have used break keyword without cancellation token. I couldn't find such concise explanation anywhere. Thank you! But can you explain use of cancellation token with iasyncenumerable?
@amantinband
@amantinband Жыл бұрын
I might do a follow up video on this. Thanks, Nayan!
@SilasPeters
@SilasPeters 2 жыл бұрын
The biggest surprise to me is how easy it is to implement lazy code using yields eveywhere!
@deus_nsf
@deus_nsf 9 ай бұрын
What about EF Core though? How will it interact with it? One SQL request per element of the collection? Or will it fetch all the collection like with a standard List?
@pianoman1973
@pianoman1973 2 жыл бұрын
Great tutorial !
@arnonoordover4054
@arnonoordover4054 2 жыл бұрын
Correct. Even in the XStreamingElement you cannot use this…😢
@auronedgevicks7739
@auronedgevicks7739 8 ай бұрын
lol by the 3min mark I already tuned out. KISS
@MyFuzzyAfterlife
@MyFuzzyAfterlife 2 жыл бұрын
Random question, but what do you use to draw the boxes and arrows on your screen ? In today’s remote working environment I’m really looking for something this
@amantinband
@amantinband Жыл бұрын
ZoomIt. Check out aka.ms/ZoomIt
@alonmore28
@alonmore28 9 ай бұрын
Would you use it as a return type in web api controllers?
@zlatkorekic
@zlatkorekic 2 жыл бұрын
Great content. Highly appreciated 👍
@zlatkorekic
@zlatkorekic 2 жыл бұрын
Please update VS Code, that notification is taking my attention to often 😁
@amantinband
@amantinband Жыл бұрын
Hahah it's already updated in the video coming out today 😉
@OmriKipi
@OmriKipi 2 жыл бұрын
Thanks ! great video , but the sound quality is not great.
@amantinband
@amantinband Жыл бұрын
I'm struggling to get good sound with the Blue Yeti. I hope the video coming out today has better sound quality. Please let me know if it's still not great! Otherwise, I think it's time to get a better mic 🙂
@caseyspaulding
@caseyspaulding Жыл бұрын
Thank you!
@pilotboba
@pilotboba 2 жыл бұрын
Do you plan to get back to the DDD / Clean Arch series? :)
@amantinband
@amantinband Жыл бұрын
Of course, there are still many great topics to cover 👀
@PetrVejchoda
@PetrVejchoda Жыл бұрын
this is friggin gamechanger!!! How do I not know about it?? Whares tha catch?? Can you turn it into IObservable??
@PetrVejchoda
@PetrVejchoda Жыл бұрын
can you turn IObservable into IAsyncEnumerable? What the hell? I want to know more!!!
@PetrVejchoda
@PetrVejchoda Жыл бұрын
being able to turn this into IObservable would make some stuff sooooo easy!!
@thanzeeljalaldeen
@thanzeeljalaldeen Жыл бұрын
is it possible to get the source code for this please?
@justinian.erdmier
@justinian.erdmier 2 жыл бұрын
This is awesome and I think will solve a pretty nasty bit of code I haven't been able to simplify. One question: Isn't printing the statement "Received 10 numbers" a bit misleading? The Console.WriteLine() only gets called once, but if the NumbersClient only returns a page of 10 (with the range of 0-9), then 11 would only be in our final results if the NumbersClient returned a second page (so actually 20 numbers). I'm not too familiar with the yield keyword, so that part kind of confused me.
@amantinband
@amantinband Жыл бұрын
Yes, it isn't very clear. It would have been clearer to put it right under the call to the client. Sorry about that 🙂
@MrAsishMohapatra
@MrAsishMohapatra Жыл бұрын
Is it not too much advertisement in a 10 minutes video you have 4-5 ads in between and in the beginning 2?
@amantinband
@amantinband Жыл бұрын
Yikes.. KZbin controls all my ad placements before and during the video
@HadrielWonda
@HadrielWonda 2 жыл бұрын
System.Linq.Async?? I wonder how long that has been functional 😊
@robertmrobo8954
@robertmrobo8954 Жыл бұрын
Why was it named IAsyncEnumerable instead of IEnumerableAsync?
@meetingattender8132
@meetingattender8132 Жыл бұрын
Cuz it isn't a method
@SolomonTheStoryTeller
@SolomonTheStoryTeller Жыл бұрын
all clean architecture implementations I have seen in my 15+ years experience and DDD across several organizations (multi billion dollars)were mostly terrible. I have come across a project two years ago that was .net core 3.1 vertical slice cqrs and mediator, fluent result, and angular as frontend. It was a beautiful project to work with. Clean architecture on the other hand, i am done with it
@amantinband
@amantinband Жыл бұрын
I've worked on and researched many projects within Microsoft and public open-source projects, and I tend to agree. Working in a small aligned team (1-5 devs) is a whole different story than bigger, unaligned teams.
@predigr
@predigr 10 ай бұрын
So, what architecture to use? where can we find some documentation?
@juke-duke
@juke-duke Жыл бұрын
Are you using Vim for your keybinds?
@amantinband
@amantinband Жыл бұрын
Yup 👍
@Abushalabi
@Abushalabi Ай бұрын
Very bad example to show the benefits of IAsyncEnumerable
Every Single LINQ Extension Method With Examples | .NET & C# Essentials
42:28
C# Async Await Mistakes | Part 1
10:19
Amichai Mantinband
Рет қаралды 36 М.
ROSÉ & Bruno Mars - APT. (Official Music Video)
02:54
ROSÉ
Рет қаралды 280 МЛН
Will A Basketball Boat Hold My Weight?
00:30
MrBeast
Рет қаралды 145 МЛН
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 275 #shorts
00:29
What is Span in C# and why you should be using it
15:15
Nick Chapsas
Рет қаралды 259 М.
C# Async Yield Return: IAsyncEnumerable will change your life!!!
10:13
Don't Use AutoMapper in C#! Do THIS Instead!
16:17
Codewrinkles
Рет қаралды 70 М.
8 await async mistakes that you SHOULD avoid in .NET
21:13
Nick Chapsas
Рет қаралды 314 М.
Don't throw exceptions in C#. Do this instead
18:13
Nick Chapsas
Рет қаралды 261 М.
The weirdest way to loop in C# is also the fastest
12:55
Nick Chapsas
Рет қаралды 253 М.
How To Design Amazing REST APIs
18:57
Amichai Mantinband
Рет қаралды 17 М.
Understand your C# queries! IEnumerable & IQueryable in explained
11:28
tutorialsEU - C#
Рет қаралды 38 М.
Clean Code is SLOW But REQUIRED? | Prime Reacts
28:22
ThePrimeTime
Рет қаралды 319 М.
How Senior Programmers ACTUALLY Write Code
13:37
Thriving Technologist
Рет қаралды 1,6 МЛН