Difference Between String, FormattableString, IFormattable in C#
C# provides different ways of manipulating strings, which can be helpful when designing and implementing systems. So, in this article, we will delve deep into the distinctions among String, FormattableString, and IFormattable in C#. Besides that, we will test whether...
Using Task.CompletedTask, Task.FromResult and Return in C# Async Methods
Developers often use async methods in C# Asynchronous Programming to improve the throughput of applications. In this article, we will learn about the usage of three different statements in C# async methods. When working with asynchronous programming in C#, developers...
Code Maze Weekly #183
Issue #183 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# Top Picks 9 "hidden" features in Visual Studio that you may not know [blog.elmah.io] Visual Studio is a great tool. But it has so many...
Optimistic Concurrency in ASP.NET Core Web API
In this article, we'll discuss a few approaches to implementing optimistic concurrency in ASP.NET Core Web API. Let's begin. Understanding...
How to Return HTTP 500 From ASP.NET Core Web API
In this article, we will learn about the different ways to return a 500 status code with ASP.NET Core Web API controller actions. Let's start!...
Dynamically Switching DbContext at Runtime Using Entity Framework Core
In this article, we will discuss why having multiple databases behind an application is useful and how dynamically switching an EF DbContext can be achieved without experiencing downtime. Feel free to check out our series of articles on Entity Framework Core. Clean and easy-to-implement guide to logging with Serilog using Azure...
Efficiently Converting Strings With UTF-8 String Literals in C#
In this article, we'll learn about the new syntax for UTF-8 string literals in C# 11, highlighting the performance enhancements vs. the older API. ...
How to Mark Methods as Deprecated in C#
In this article, we will explore how we can mark methods as deprecated and propose newer alternatives to developers in C# by providing useful information. A good breakdown of Moq's situation for those that haven't heard what's...
Targeting Multiple Frameworks in a .NET Project
In this article, we're going to explain the importance and benefits of targeting multiple frameworks in a single .NET project. Let's start....
Prevent SQL Injection With EF Core, Dapper, and ADO.NET
SQL Injection is a severe security vulnerability that can harm applications that use databases. In this article, we'll learn about SQL Injection attacks, what they can do, and how to protect our applications from them. We'll focus on using popular ORM tools like EF...