In C# 10, a new feature was introduced that allows you to specify global using directives. This feature lets you define using directives that apply to all the files in your project, reducing the need for repetitive using statements in each file. This can be particularly useful for commonly used namespaces. How to Specify Global … Continue reading Global Using Directives
Month: July 2024
Integration Tests for Minimal API with SQL Server TestContainers
Integration tests are important for ensuring that your application components work together as expected. When it comes to testing APIs, having a reliable and isolated database environment can significantly improve the accuracy of your tests. By using test containers over other concepts like in memory database, you will actually test the behavior end-to-end, including the … Continue reading Integration Tests for Minimal API with SQL Server TestContainers
Using glob patterns in *.csproj files
Here's a cool article on simplifying your csproj files by using glob pattern for paths and file extensions https://mykeels.medium.com/using-glob-patterns-in-csproj-files-95122c7f0870 Glob patterns are like wildcard-based rules that match file paths. They let you specify file patterns using wildcards like * and ** to match multiple files with similar characteristics. In this case, we want to target all C# files (*.cs) … Continue reading Using glob patterns in *.csproj files
Creating Interactive Console Applications in C#
Console applications (or command line interfaces - CLI) have long been a staple for developers due to their simplicity and ease of use. However, with the right tools and techniques, you can build sophisticated console applications that are both interactive and user-friendly. Let's explore how to create advanced console applications in C# using Spectre.Console.Cli for … Continue reading Creating Interactive Console Applications in C#