C# 10.0 and .NET 6.0 will be released in November 2021. Time to look at the new language features with a little series of blog posts. Let's start in this blog post with a very simple feature that is called File Scoped Namespaces.(more…)
MvvmGen 1.1.0 and the New Special Edition: PURE CODE GENERATION – No Runtime Dependency For Your Project!Thomas Claudius Huber
In the last blog post I introduced you to MvvmGen, the new MVVM library built with a strong focus on C# Source Generators. Some of you asked in the comments of the blog post and also per email if also the library could be generated, so that there is no runtime dependency.
Today, I'm happy to announce that this is now possible. Check out the requested special edition on NuGet: MvvmGen.PureCodeGeneration. This edition generates everything for you, not only the ViewModels, but also the full library. That means, there is no runtime dependency for your application. Let's look at this edition in this blog post, and let me also show you what's new in version 1.1.0.(more…)
Introducing the brand-new MvvmGen Library – Writing ViewModels for your XAML Applications Has Never Been More Productive and EasierThomas Claudius Huber
In the nights of the past weeks, I built a brand-new MVVM library that you can use in your XAML-based .NET applications. The library is called MvvmGen. It uses Roslyn-powered C# Source Generators to create all the ViewModel-specific boilerplate for you, and it is built with .NET Standard 2.0, which means you can use it in your WPF, WinUI, Uno Platform, Xamarin.Forms and .NET MAUI apps.
MvvmGen is a modern, next-generation MVVM library that I built from ground up with a strong focus on C# Source Generators. All the repetitive code (also known as boilerplate) that you normally write to create a ViewModel class gets generated for you. So, let's welcome the new library and let's take a look at it.(more…)
To store local data, today's browsers support a local storage and a session storage. The difference between the two is that the session storage is only available per tab, and the stored data is deleted once you close the tab with the application. The local storage on the other side stores data across sessions. Even when you close the browser and when you re-open it again, the data of the local storage is still there. It will be there as long until you delete it.
So, the difference between the two is how long the data is stored. Beside that, they work exactly the same. Both can store key/value pairs, and those key/value pairs are stored in plain text.
In this blog post, let's look at how to use the local storage and the session storage in your Blazor App.(more…)
Recently I was asked by a developer what this code block here actually is:
public Friend(string firstName, string middleName, string lastName) => (FirstName, MiddleName, LastName) = (firstName, middleName, lastName);
This is actually a constructor that uses an expression body and tuples.(more…)
C# 9.0: Covariant Return Types – Specify More Specific Return Types in Overridden Methods and PropertiesThomas Claudius Huber
In the previous blog posts you learned about different C# 9.0 features:
- Top-level statements
- Init-only properties
- Target-typed new expressions
- Improved Pattern Matching
- Pattern Matching in Switch Expressions
In this blog post, let's look at another very interesting feature of C# 9.0, the covariant return types.(more…)