This is a long story about me recalling some of the finer details about how async-await works in dotnet, notably how a function returning a Task can execute synchronously. With thanks to Stephen Toub, who is the reason I did not waste more time on this than I did - and apologies for what is probably going to be an embarassing mix-up of terms. TL;DR Async-await is smart. If you call an async method that returns a task that is completed from the start, the caller won’t schedule the remainder of it’s execution as a continuation but continue synchronously.

Continue reading

Today marks the one-year anniversary of me stepping into a formal architecture role from that of a backend developer, and I’d like to reflect a bit on what I’ve learned during that time. Please bear in mind, I work out of a centralized architecture office - the infamous ivory tower - so these learning are probably mostly relevant in similar organization setups - and you (well, your boss’s boss, probably) should work hard to change it1.

Continue reading

Tl;dr: Enable clean and easy changing of hosting model of Blazor app by packaging your UI in a Razor Class Library and using inversion of control to provide hosting model-specific data providers to your views. In a Blazor WASM client project, implement the service using an HttpClient accessing an API. In a Blazor ServerSide (or during prerendering), implement the service using more direct access. Source code is available at https://github.com/joelving/blazor-hosting.

Continue reading

This post is part of a series exploring some of the newest features of .Net. Last time we looked at how we can use pipes for parsing stream-data with very little overhead. We used it to built our own minimal iCal-parser, to be used in a remake of a time reporting tool for contractors like myself. In this installment, we’ll add a background queue and processor to decouple the fetching and parsing from our web interface.

Continue reading

It’s a wonderful time to be a .NET-developer. The .NET Core-team and so many others in the community is doing absolutely marvelous work reinventing the platform. As a web dev, I’m inundated with cool new toys to try out - many more than I can get around to: Pipe, Span<T>, Memory<T> for near-zero-allocation byte massaging; IHostedService for running background tasks along your website; typed HttpClient, SocketMessageHandler and Polly for making Http even more manageable; SignalR for real-time communication; Blazor for frontends in C#.

Continue reading

Author's picture

Peter Toft Jølving


Freelance full-stack web developer and solution architect

Copenhagen, Denmark