How to Get the Quarter of a Given Date in C#
Manipulating DateTime values is one of the most common operations in any application. Have we ever asked ourselves how to extract the quarter of a given date value in C#? In this article, we are going to understand how we can derive the quarter and financial quarter...
Code Maze Weekly #204
Issue #204 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# Top Picks Mastering Tuples in .NET [dotnettips.wordpress.com] Tuples are a useful and practical .NET structure. In this article by David...
How to Fix CORS Error With AnyOrigin and AllowCredentials
In this article, we will learn how to fix the CORS protocol error with AnyOrigin and AllowCredentials in ASP.NET Core (The CORS protocol does not allow specifying a wildcard (any) origin and credentials at the same time). We assume you know the basics of CORS and how...
How to Add Unique Constraints to a Property in EF Core Code-First
In this article, we'll see how we can apply unique constraints to a property in EF (Entity Framework) Core using the code-first approach. ...
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...