Cancel Preloader
Combining Dependency Injection with Delegates.

Combining Dependency Injection with Delegates.

One of the conceptual topics of .NET Core is dependency injection, which is very widely used. Also, working with delegates can give you incredible power in programming. One of the most practical ways to use delegate is to use it as a parameter. In fact, calling a delegate will call the method or methods to which the desired delegate is referred, and the very important thing is to pass the parameter and receive the output to the delegate itself, which can make your work professional.

The StringBuilder class and its difference with String.

The StringBuilder class and its difference with String.

If we want to edit a string, instead of being edited in the same space as before, it creates a new string in another place of the memory, and if the editing, replacement and deletion of strings are done repeatedly and in batches, the efficiency of the system and performance will decrease.To solve this issue in C# language, we use StringBuilder class. After changing the previous string to a new string, this class does not use a new memory for this task, but dynamically expands the previous memory to increase the characters of the string!

Calculations on large numbers with a length of several thousand digits.

Calculations on large numbers with a length of several thousand digits.

Variables such as int, long, etc. do not work for calculating large numbers of hundreds or thousands of digits. For this type of variables, we can use the powerful BigInteger class. BigInteger class placed in System.Numerics namespace. Now the question arises, what is the limit for entering numbers in this class? ; this limit can be different according to your system, but we were able to store a 500,000 digit number in a computer with 16 RAM just for testing using the BigInteger class !