Search

How to use Builder Pattern in C#
By Tan Lee Published on Feb 16, 2024 888

The Builder pattern is a creational design pattern that enables the step-by-step construction of complex objects.

Read more
How to use Factory Method Pattern in C#
By Tan Lee Published on Feb 16, 2024 764

The Factory Method is a creational design pattern that defines an interface for creating objects in a superclass.

Read more
How to use Singleton pattern in C#
By Tan Lee Published on Feb 16, 2024 754

The Singleton is a creational design pattern that ensures a class has only one instance.

Read more
Avoiding the Common Pitfalls of the == Operator in C#
By Tan Lee Published on Dec 27, 2024 293

If you encounter an issue with the equality operator (==), specifically when comparing values of different types, extra caution is needed.

Read more
Pass reference type using "ref"
By Tan Lee Published on Dec 27, 2024 236

When working with reference types in C#, passing them to methods allows modifications to the object’s properties within the method.

Read more
Cannot Initialize a By-Reference Variable with a Value
By Tan Lee Published on Dec 27, 2024 243

With the introduction of "ref return" in C# 7.0, developers can now return a reference to a value from a method.

Read more
Curly Braces in string.Format in C#
By Tan Lee Published on Nov 10, 2024 387

In C#, if you want to use curly braces ({ and }) as literal characters within a string.Format() method, you need to escape them by doubling the braces.

Read more
C# Union
By Tan Lee Published on Dec 27, 2024 273

In C/C++, a union is a user-defined type where all its members share the same memory location.

Read more
How to check the size of HTTP resource in C#
By Tan Lee Published on Dec 27, 2024 292

The HTTP HEAD command is useful when we want to know the size of a resource, like a video or an image, before downloading it.

Read more
How to check internet connectivity in C#
By Tan Lee Published on Dec 27, 2024 339

The method NetworkInterface.GetIsNetworkAvailable() in .NET, available since version 2.0, checks if a network connection is available.

Read more