Difference Between Build and Publish in Visual Studio
Has anyone ever wondered about the difference between the build and publish functions in software development? As we know, both the build and publish are important steps in software development, especially when using Visual Studio for .NET applications. Let’s check...
Fastest Method to Check if a Date Is Less Than or Equal to Today’s Date in C#
In our applications, there may be a need to check if an input date string is less than or equal to today's date. This information is crucial for various scenarios, including scheduling events, validating user-entered dates, and updating entities in our database. In...
How to Inject a DbContext Instance Into an IHostedService
In this article, we'll take a look at how to inject a DbContext instance into an IHostedService. We'll also point out some important concepts we should be aware of. Do you know how to throw and catch all exceptions...
Single and Split Queries in Entity Framework Core
Entity Framework Core (EF Core) offers developers two powerful querying strategies: Single and Split Queries. In this article, we'll delve into the pros and cons of each, helping us make informed decisions for efficient data retrieval. The sample in our repository...
Clean Architecture in .NET
In this article, we are going to discuss Clean Architecture in .NET. So let's get going.
VIDEO: .
Did you know there are 8 different ways to set the URLs in ASP.NET...
How to Check if an Object Is a Number in C#
In this article, we will explore different methods to check if an object is a number. C# is a strongly typed programming language, which ensures...
Creating Conditional Required Attributes for Validation in .NET Web API
Whether seasoned or just getting started in the .NET world, we've all encountered situations where we need to conditionally validate some attributes of data based on specific conditions. In this article, we're going to learn about creating conditional required...
How to Log a Class and Method Names Using Serilog
Developers must implement an efficient logging system to maintain and troubleshoot applications effectively. One popular logging library that provides powerful logging capabilities is Serilog. In this article, we will talk about how to log class and method names using...
How to Overwrite DateTime.Now During Testing in .NET
In this article, we'll look closer at how we can overwrite the DateTime.Now property when testing applications in .NET. Let's dive in!...
New Features in C# 12
In this article, we will explore new features in C# 12. We will describe primary constructors, collection expressions, inline arrays, and other newly introduced features. We'll need the latest Visual Studio 2022 or .NET 8 SDK to try each of these new C# 12 features,...