How To
How to hide “Showing 1 of N Entries” with jQuery datatables
By Tan Lee Published on May 28, 2024 2.65K
To hide the "Showing # to # of # entries" message in jQuery DataTables, you can use CSS to hide the element containing this information.
How to kill process by name in C#
By Tan Lee Published on Oct 10, 2024 881
To kill a process by name in C#, you can use the System.Diagnostics namespace, which provides the Process class.
How to convert a dictionary to a list in C#
By Tan Lee Published on Dec 20, 2024 2.73K
In C#, dictionaries are commonly used to store key-value pairs, but sometimes, you might want to work with a list of these pairs instead of a dictionary.
C# Convert a list to a dictionary
By Tan Lee Published on Jan 21, 2025 478
The easiest way to convert a list into a dictionary is by using the LINQ ToDictionary() method.
How to set json serializer settings in ASP.NET Core
By Tan Lee Published on Dec 27, 2024 624
In ASP.NET Core, you can configure JSON serializer settings for your application in a few different ways, typically through the Startup.cs or Program.cs file.
Serialize a tuple to JSON in C#
By Tan Lee Published on Feb 05, 2025 673
When you serialize a tuple to JSON, the underlying ValueTuple field names, Item1 and Item2, are used. This is true even if you are using a named tuple. The field names you specify in the tuple declaration won't be reflected in the JSON.
How to check if a nullable bool is true in C#
By Tan Lee Published on Dec 24, 2024 626
In C#, nullable types allow you to represent data that can be absent or undefined, in addition to its usual valid values.
How to get application folder path in C#
By Tan Lee Published on Dec 05, 2024 1.2K
To get the application folder path in a .NET application, you can use the Server.MapPath() method in ASP.NET or AppDomain.CurrentDomain.BaseDirectory for other types of applications.
How to get the current working folder in C#
By Tan Lee Published on Nov 13, 2024 935
In C#, you can get the current working directory using the Directory.GetCurrentDirectory() method, which is part of the System.IO namespace.
Using LINQ to remove elements from a List<T>
By Tan Lee Published on Dec 10, 2024 468
In LINQ, you cannot directly remove elements from a List<T> because LINQ itself is designed primarily for querying and transforming data, not for modifying collections.
Enum Generic Type Constraint in C#
By Tan Lee Published on Feb 04, 2025 519
In this post, let's look at how we can use Enum as a generic type constraint in C#. This feature was introduced in C# 7.3 and allows you to enforce that a type parameter is an enum, providing compile-time safety for your generic methods.
How to use Parallel.For and Parallel.ForEach in C#
By Tan Lee Published on Jan 06, 2025 1.1K
Parallel programming in .NET enables more efficient utilization of system resources and provides greater control over program execution.