How To
How to use pattern matching in C#
By Tan Lee Published on Jan 03, 2025 204
Leverage the enhanced pattern matching capabilities in C# 8.0 to write code that is cleaner, more maintainable, and more efficient.
Scheduling Jobs with Quartz.NET in ASP.NET Core
By Tan Lee Published on Jan 03, 2025 441
Quartz.NET is a job scheduling framework that allows you to schedule background tasks in an ASP.NET Core application, often for tasks that need to run at predefined intervals.
How to use ValueTuples in C#
By Tan Lee Published on Jan 03, 2025 215
A Tuple is a data structure consisting of an ordered, fixed-size collection of immutable elements, each of a specific type that cannot be modified.
How to use asynchronous streams in C#
By Tan Lee Published on Jan 03, 2025 212
In C# 8.0, asynchronous programming is enhanced with the introduction of IAsyncEnumerable, allowing for the efficient consumption and creation of data streams asynchronously.
How to log data to SQL Server in ASP.NET Core
By Tan Lee Published on Mar 08, 2020 357
Logging is crucial for detecting and debugging issues in applications, and Serilog enables .NET developers to log data in a structured format to various targets like the console, files, and databases.
How to use indices and ranges in C#
By Tan Lee Published on Jan 03, 2025 269
In C# 8.0, two important new features, System.Index and System.Range, have been introduced to simplify indexing and slicing operations for collections.
DateTime.Now vs DateTime.UtcNow
By Tan Lee Published on Jan 03, 2025 451
In this article, we explore the differences between DateTime.Now and DateTime.UtcNow in C#, focusing on time calculations and the significance of UTC.
How to convert a Unix timestamp to milliseconds in C#
By Tan Lee Published on Jan 03, 2025 391
In C#, to get the current Unix timestamp in milliseconds, you can use the following code:
How to Create an exception handler in ASP.NET Core 8
By Tan Lee Published on Mar 08, 2020 353
Microsoft’s .NET 8 release introduced the IExceptionHandler interface in ASP.NET Core 8, improving how exceptions are handled in web applications.
How to use primary constructors in C#
By Tan Lee Published on Jan 02, 2025 292
In C# 12, primary constructors are introduced for classes and structs in addition to record types.
How to use IEnumerable, ICollection, IList, and IQueryable in C#
By Tan Lee Published on Jan 02, 2025 556
C# provides robust support for working with collections of data through various classes and interfaces.
Choosing Between Classes, Structs, and Records in C#
By Tan Lee Published on Jan 02, 2025 308
In this post, we will learn how to use classes, structs, and record types in C#.