Strategy design pattern in C#


Strategy is a design pattern where a set of rules is defined and allows us to have different implementations. For example, suppose we want to write a repository for reading data that allows us to change where the data is read (with minimal changes to the code) in the future. We can store ....
Read more

How is null stored in ValueTypes in c#?


In C#, there are two types of data types: ValueType and ReferenceType. These types have their own unique characteristics. One of the features we want to discuss in this article is the ability to assign a Null value to ValueTypes. ReferenceTypes do not store the actual data; instead, they store ....
Read more

Implementing FileHelper for compatibility with all operating systems in Asp.Net Core


When working with files in C#, we usually consider them to work correctly on all operating systems, as file paths differ between Windows, Linux, and macOS. For example, in Windows, we use "\" to separate directories, while in Linux, "/" is used. If we have specified paths in our code ....
Read more

Building projects before git push


When we work for several hours and get tired, it is possible to push the project quickly and not check whether the project will be built or not. In Git, it is possible to run a series of commands before pushing. Therefore, we can use ....
Read more

Writing test with a real database and xUnit


When writing tests, in some cases we need to connect with the database to read data from it or store records in it. If we use a fixed database, the values ​​in the database will change every time the tests are run, and if someone else works with the database and changes ....
Read more