How To

How to use ValueTuples in C#
1/3/2025 4:33:50 AM  82

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#
1/3/2025 3:43:25 AM  52

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
1/3/2025 3:28:47 AM  100

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#
1/3/2025 3:09:54 AM  78

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
1/3/2025 1:54:35 AM  104

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 get unix timestamp in C#
1/3/2025 1:34:29 AM  982

In C#, you can get the Unix timestamp, which represents the number of seconds that have elapsed since January 1, 1970 (Unix epoch), in a couple of ways.

How to convert a Unix timestamp to milliseconds in C#
1/3/2025 1:23:22 AM  92

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
1/2/2025 9:55:51 AM  116

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#
1/2/2025 9:35:06 AM  76

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#
1/2/2025 9:12:19 AM  237

C# provides robust support for working with collections of data through various classes and interfaces.

Choosing Between Classes, Structs, and Records in C#
1/2/2025 8:45:29 AM  134

In this post, we will learn how to use classes, structs, and record types in C#.

Object Services Layer in Entity Framework
1/2/2025 8:22:35 AM  39

To reduce the impedance mismatch between the object model and data model in an application, you can leverage the Object Services Layer in ADO.NET Entity Framework.