One criticism about Asp.Net web api is the ceremony to create a simple web api. This criticism has some reason: when you create a bare-bones web api with this command: dotnet new…
Tag: C#
Using the Win32 Api in a C# program with C#/Win32
Introduction One of the interesting things that C#9 brought is the introduction of Code Generators. When compiling the code, the C# compiler can generate extra code and add it to your project,…
HTTPRepl and OpenApi features for Asp.NET WebApi
With .NET 5.0, two small features were introduced to Asp.NET and were almost unnoticed: Open Api and HTTPRepl. Open Api is not something new, it’s been available for a long time, but…
Using the new WebView2 in a WPF app
Times have changed and Microsoft is not the same: Edge, the new Microsoft browser has been remodeled and now it’s using the Chromium engine, an open source browser engine developed by Google….
Implementing the MVVM pattern in a WPF app with the MVVM Community toolkit
Introduction You have an old, legacy app (with no tests), and its age is starting to show – it’s using an old version of the .NET Framework, it’s difficult to maintain and…
Converting XML data to JSON
There are times when you need to convert data from one format to the other and you don’t have any tools to do it, or you must do it so many times…
Modernizing your .NET app with WinUI3
In the last post I showed how to use Xaml Islands to modernize your .NET app. As you could see, there are a lot of steps and the procedure is a little…
Modernizing your .NET app with Xaml Islands
You have an app developed a long time ago and it’s showing its age. It’s time to modernize it, but rewrite isn’t an option: it’s too complicated to rewrite it and it’s…
Mocking non-virtual methods of a class with Microsoft Fakes
After I finished last article, I started to think that there should be another way to test the non-virtual methods of a class. And, as a matter of fact, there is another…
Mocking non-virtual methods of a class
Introduction Usually I use interfaces for my unit tests. This is a good practice, and should be followed when possible. But, last week I was testing some legacy code, which had no…