.NET Annotated Monthly | April 2022
Did you know? ReSharper once existed as a standalone IDE built with WinForms, in addition to being a plugin to Visual Studio. If you’re interested in ReSharper’s and Rider’s inner workings, Maarten Balliauw has a great talk on the subject.
Updates for spring in the Northern Hemisphere/fall in the Southern Hemisphere:
- Announcing .NET 7 Preview 2 – The New, ‘New’ Experience
- ASP.NET Core updates in .NET 7 Preview 2
- Announcing .NET MAUI Preview 14
- .NET 5.0 will reach End of Support on May 08, 2022
We’d like to thank Nick Chapsas for curating this month’s featured content, as well as the introductory trivia. Nick is a Senior Engineering Manager at Checkout.com, a YouTube Content Creator for .NET, a Microsoft MVP and a course author. You can also find him on Twitter where he doesn’t talk about himself in the third person.
The development of .NET 7 continues and this month .NET 7 Preview 2 was released. The biggest feature of this preview is the introduction of the Regex Source Generator (it’s pronounced Regex btw) which allows developers to automatically generate source code based on the Regex pattern specified. This means that applications can get a significant boost to their startup time and also a minor boost to their Regex match time. If you’d like to know more about how this works check out my video on the topic.
Minimal APIs were introduced in .NET 6 and very quickly people started getting their hands dirty and seeing what they can build with these newly granted low-level powers. One of the projects that has stood out to me is FastEndpoints. It is an open-source project that allows people to build elegant and fast APIs in .NET using Minimal API technology at its core. The approach almost looks too good to be true, but if you’re looking for a simple and clean way to build APIs in .NET you should check the project out.
Event Sourcing seems to be one of the most popular patterns for software development and for good reason. The idea that every change to the state of an application is captured in an event object, and that these event objects are themselves stored in the sequence they were applied to for the same lifetime as the application state itself, is brilliant. It does, however, sound very complex. Anton Wieslander at his YouTube channel “Raw Coding” has taken it upon himself to break this concept down to its fundamentals and show us how we can implement it in C# in his unique teaching way.
Still can’t make sense out of the new application bootstrapping approach in .NET 6? Wondering what happened to Startup.cs? Tim Corey has you covered. In one of his latest videos, Tim is going through the .NET 6 changes step by step and explains how the Startup.cs was changed to be integrated directly into the Program.cs.
Are videos not your thing? Do you prefer to listen to podcasts when working or on long drives? Then I got you covered. Dan Clarke and his Unhandled Exception Podcast has quickly become one of my favorite podcasts to listen to. And, what a coincidence! I happen to be the guest of the latest episode where me and Dan geek out on several topics around software development and .NET.
To wrap this up, I’d like to give a shoutout to a new GitHub repository by Matthias Jost called dotnet-content-creators. If you’re looking for people to follow and learn from in the .NET space, this repository contains a lot of the people that should be on your radar. If you know someone who’s creating content and isn’t in that list, feel free to create a pull request.
And as always, keep coding.
.NET & programing tutorials and tips
Below are some recent articles on .NET and related topics.
.NET tutorials and tips
- Replicating Contact & Message UI in Xamarin Forms – Leomaris Reyes demonstrates a really nice way to layout contacts for messaging. Done in Xamarin Forms.
- StateLayout with Collections in Xamarin Forms/MAUI – Displaying different views/layouts is often a tedious task to do. Charlin Agramonte breaks it down and shows the best way to do it.
- Using custom media types in .NET – Irina Scurtu shows how to use and create custom mime types in .NET, how to respond to them in your APIs, and answers some common questions regarding mime types in .NET.
- Cancelling await calls in .NET 6 with Task.WaitAsync() – Andrew Lock shows an eloquent technique to cancel await calls.
- Middleware in ASP.NET 6 – Intro and Basics – A major value proposition of .NET is middleware! Matthew Jones goes back to basics in demonstrating what you need to know about ASP.NET middleware.
- DateOnly in .NET 6 and ASP.NET Core 6 – .NET 6 has a new DateOnly and TimeOnly struct and Zijian shows us how and where we can use it. He also covers nice tidbits about integrating this type with code generators, TypeScript, and other languages and techs.
- C# 10 New Features and How to Use RabbitMQ in ASP.NET Core – Check out C# 10’s new features and then get to learning about RabbitMQ in ASP.NET Core by Code Maze.
- Let’s Learn Blazor: Creating a Desktop App with Electron.NET – Cross-platform apps are really important to many businesses, not to mention apps that are deployed from app stores. Learn how to do cross platform Blazor with this article by Christopher Laine.
- Loop Around Index with C# Collections and Using LibMan To Manage Client-Side Dependencies – Two great posts by Khalid Abuhakmeh. This month it’s working with C# collections and LibMan, the seriously underrated and often overlooked package manager for .NET.
- Domain Logic: Where does it go? – Derek Comartin answers this question regarding use of a domain model for domain logic, as well as common programming pattern errors found in domain logic.
- Using HTTPS in Your Development Environment – Andrea Chiarelli outlines several reasons why you should use HTTPS in your dev environment. Andrea also shows you how to set it up and how it works..
- .NET6 Web API CRUD Operation With MongoDB – A classic CRUD example, but with MongoDB by Naveen Bommidi.
- How to perform CRUD operations with Entity Framework Core and PostgreSQL – In a similar notion, Davide Bellone has written a classic CRUD example but with PostgreSQL.
- Connecting a .NET Application With MongoDB Atlas – Here’s more MongoDb: Assis Zang provided a step-by-step guide on connecting with the Atlas database from MongoDb.
- Integration Testing ASP.NET Core 6 WebAPI Applications – Claudio Bernasconi goes into detail on how to do integration testing in ASP.NET Core 6 WebAPI (though it will work for any ASP.NET app). Blog post + video.
- Combining Bearer Token and Cookie Authentication in ASP.NET – Someone finally had enough and documented their frustrations with multi-scheme authentication in .NET. So thank you Rick Strahl! This is much needed.
- Serialization and Deserialization in C# – From C# to JSON and back, Code Maze shows basics of serialization and how you can use it in .NET apps.
- Search videos through the YouTube Data API from C# – This is handy! Who at some point didn’t want to make a quick app that tracks shows you want to watch, or bookmarks videos? Tutorial by Thomas Ardal.
- .NET 4.x app running in a container using Docker – It’s going to be a lot easier maintaining legacy apps in containers than trying to recreate the dev or production environments so this post by Gregor Suttie demonstrates how to do it.
- Creating a Windows Service with .NET 6 – Not everyone creates microservices and cloud enabled solutions. Some of us are creating classic and mature solutions like a service in Windows, for those occasions when it’s appropriate. Christian Nagel shows how to do this.
Daniel tweets some excellent pointers on the popular AutoMapper library.
Related programming tutorials and tips:
- How To Create a Table in SQL Server – Another back to basics with Aubrey Love showing how to create a table in SQL. Every .NET developer does this at some point when they have no DBA to manage databases or perhaps when prototyping.
- Using Conditional Logic to Improve Form Design and UX – Suzanne Scacca shows the results of conditional logic after it has been applied to a UX. Consider the scenarios here and convert them into the programming language of your choice.
- 10 Reasons Why Software Projects Fail – While it seems like the reasons for failed projects are far more than 10, the 10 that Mahesh Chand outlines here are often cited. Read on so you can get ahead of the game before the project goes into the red zone.
- How to delete all merged git branches with one terminal command – Are all those branches clogging up your screen? You bet! Salma Alam-Naylor shows how to get rid of all those pesky merged branches with one command to rule them all! Ok, ok, it’s one command for this specific scenario but it’s a pretty good one.
Interesting and cool stuff
Check out these recent off-topic links.
- How To Raise Your Ideas Up The Chain Of Command – If we want our ideas to launch inside our workplaces then we have to sell those ideas to management. Unfortunately there’s no way around this. So Sam Milbrath hopes this post will help you convey why your ideas matter.
- Embracing ambiguity in software with one of YouTube’s UX engineers – It’s hard to do! Programmers like certainty and uncertain outcomes makes our lives difficult. In this podcast, Eira May interviews Mattaniah Aytenfsu from YouTube on how to work with ambiguity swirling around you.
This is really interesting to think about. In many places, folks don’t use cover letters anymore. Instead, they send an email and the email text serves as the cover letter. Or they upload a resume through a corporation’s website and there is no option to upload a cover. Should we revive this old practice? Do you think it makes a difference?
I can confirm that I just read a “cover letter” (only a paragraph) that changed my view on candidate.— Kyle Welch (@kylewelch) March 30, 2022
It was short and captured why this role was special to them.
I was on the fence and I saw good things but based on exp I was not sure. They fixed that in 2 sentences.
And finally, the latest from JetBrains
Here’s a chance to catch up on JetBrains news that you might have missed:
As always, our .NET Guide is available as a learning tool with tons of videos, tips, tricks, and info on a variety of .NET related topics.
Feel free to share content that you find useful with other readers. Don’t keep it to yourself! Send us an email with your suggestions for publication in future newsletters. Thank you for reading.
Subscribe to Blog updates
Thanks, we've got you!