Category «C#»

How to Become a Programmer in your 30-40s?

In this topic, we will talk about how a novice programmer who is already 30 or 40 years old can find his first job and how to work and compete with those who are now barely in their 20s. Alexey Korepanov, who is a programmer for 17 years and now working in Netherland. How will …

What is Abstract Factory? Real Example on C#

The Abstract Factory pattern provides an interface for creating families of related objects with specific interfaces without specifying specific object data types. When to use an Abstract Factory? When the system should not depend on how new objects are created and laid out When the created objects are to be used together and are related …

DateTime Format C# All Standard Formats

This is a reference article. The next table will contain all standard DateTime formats in the C# with examples: How to set Custom Format? A number of string formats are used to format date and time output. Here is a code snippet with standard DateTime formats DateTime today = DateTime.Now; Console.WriteLine($”D: {today.ToString(“D”)}”); Console.WriteLine($”d: {today.ToString(“d”)}”); Console.WriteLine($”F: …

What Are benefits of using REF keyword in C#?

There are two ways to pass parameters to a method in C#: by value(usual method) and by reference. When passing parameters by reference, the ref modifier is used before the parameters: void Increment(ref int n) { n++; } But what’s the point then that this parameter will be passed by reference? When you pass a …

Popular Interview Questions for .Net Developers

I prepared a basic list of popular interview questions for .NET developers. Currently, there are 50+ questions. Most of these questions apply to junior developers. As far as possible, I will add questions for middle and senior developers. 1. What are the principles of object-oriented programming? Abstraction – separating the idea from the implementation Polymorphism …

How to format DateTime to 24 hours time?

To convert the DateTime value to its equivalent string representation you should use ToString(format) function. To display time in 24 hours format check this example: var today = DateTime.Now; Console.WriteLine(today.ToString(“HH:mm”)); > Read the full list of DateTime C# Formats. Additional ToString() overloads. Read more here.

6 Improvements For LINQ in .NET 6

Despite the powerful capabilities of the C# programming language, Microsoft continues to improve its offspring. Today we will look at what features have appeared in LINQ (Language-Integrated Query). I will say right away that you will not see any breakthrough, mainly syntactic sugar, which speeds up the development process. The demonstration will take place immediately …

What is .NET Standard and When to Use It?

Modern applications often need to be adapted to different types of devices and operating systems, and therefore to different implementations of .NET (.NET Framework, .NET Core and Xamarin). In this case the maintaining shared code becomes a challenge. You need to understand what APIs are available and make sure that common components only work with …