How to Send a JSON Object Using HttpClient in .NET
In modern web development, sending JSON objects over HTTP has become a common practice for exchanging data between clients and servers. In this article, we will explore how to send a JSON object using HttpClient. A nice breakdown of the heap data structure...
Difference Between Abstraction and Encapsulation in C#
Let's explore the differences between abstraction and encapsulation in C#. Abstraction and encapsulation constitute fundamental concepts in object-oriented programming (OOP) and coexist in C#. Each of them fulfills key roles in the design and implementation of classes...
Architecture Tests in .NET with NetArchTest.Rules
In this article, we'll explore how to use the NetArchTest.Rules library to write architecture tests for our .NET applications. Let's...
How to Create an Outer Join in LINQ – (Left and Right)
In this article, we'll discuss how to create an outer join in LINQ. Most used are left and right outer join, but we'll also talk about less common ones. It's hard to find an application that doesn't rely on data. We often use just a single data source. But sometimes...
Read a Text File Without Specifying the Full Path in C#
In .NET applications, reading text files is essential for tasks like loading configurations, processing data, and parsing logs. In this article, we look at the file's relative and absolute paths and set up a new project to read a text file using its relative path. 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. [sc name="videolink" videotitle="Clean Architecture with...
How To Check if a URL Is Valid in C#
In the world of web development using .NET, it's crucial to make sure the web addresses (URLs) our application uses are correct and safe. In this article, we will understand the basics of how to check if a URL is valid in C#. We'll include some easy-to-understand code...