Below you will find pages that utilize the taxonomy term “C Sharp”
Testing list contents with xUnit and Assert.Collection
xUnit has become the favorite unit testing tool for many .NET developers. The assertion library documentation however is quite sparse. Let’s explore the testing of list collections using a lesser known xUnit assertion,
Serializing .NET 6s new DateOnly to JSON
The DateOnly type that was introduced in .NET 6 is convenient for exchanging strongly typed date information in APIs. Unfortunately, the ever popular JSON format has no standard for date fields. This leads to UnsupportedTypeConverter errors when trying to serialize these fields using System.Text.Json. This article explains how to create a custom JsonConverter to define the serialization format for DateOnly fields and how to show the correct format in generated Swagger documentation.
Adding a .NET 6 minimal Web API to a Blazor Server project
The new minimal APIs in .NET 6 make creating low-ceremony microservices and backends very appealing, and they’re also a great way to add simple endpoints to Blazor Server applications, complete with Dependency Injection and JSON serialization.
Draw a line chart with Blazor and SVG
Blazor is so great that I’d rather not use anything else. That made me wonder: can I build SVG files using Razor syntax and is that a good idea? The answers are absolutely and definitely!
Trix editor as a Blazor Component
Trix is a rich text editor that is popular with Ruby on Rails developers. In this post we’re going to take Trix out of Rails and use it inside an ASP.NET Blazor application by making a drop in replacement for Blazor’s InputText component.
Forcing C# indentation in Visual Studio Code using Omnisharp
I always thought indentation was a solved problem, until I needed to adapt to something different. Here’s a trick to force correct indentation for your .NET projects by using the Omnisharp language server.
It's time to consider C# and .NET 5
People have been sleeping on .NET and they’re mising out. With the release of .NET 5 this month, it’s time to consider C# .NET for your next project! It’s a great general-purpose software framework that’s likeable, in high demand, easy to sell to customers, has decent performance, is completely open source, mature and has a large backing. What more could you want? Let me explain to you why I see it as the best alternative for Ruby on Rails and share some resources to get you started.