How To
How to implement database connection resiliency in ASP.NET Core
By Tan Lee Published on Dec 30, 2024 764
In this article, we will learn how to leverage connection resiliency in EF Core to automatically detect errors and retry failed database commands.
How to use FluentValidation in ASP.NET Core
By Tan Lee Published on Dec 30, 2024 615
FluentValidation is an open-source library for validating data in ASP.NET Core applications, helping to maintain clean, organized, and maintainable code.
How to chunk data using LINQ in C#
By Tan Lee Published on Dec 30, 2024 601
The Chunk method in LINQ is a powerful tool for dividing large datasets into smaller, more manageable chunks, improving efficiency in data processing.
How to split strings efficiently in C#
By Tan Lee Published on Dec 30, 2024 642
Optimizing performance in .NET applications involves careful resource management, especially when working with strings.
How to use ref structs in C#
By Tan Lee Published on Dec 30, 2024 375
C# 13 introduces new ways to take advantage of ref structs to optimize memory usage and eliminate garbage collection (GC) overhead.
This package is signed but not by a trusted signer
By Tan Lee Published on Dec 30, 2024 393
The error "This package is signed but not by a trusted signer" typically occurs when you are installing a package on Windows or another system that uses digital signatures to verify the authenticity of the software.
How to convert file data to byte array in C#
By Tan Lee Published on Dec 30, 2024 689
If you're uploading a ZIP file to Azure Blob Storage, you would first need to convert the file into a byte array.
How to get Url Referrer in ASP.NET Core
By Tan Lee Published on Dec 27, 2024 2.23K
In ASP.NET Core, the referrer URL (the page that made the request) can be retrieved from the `Request.Headers` collection, where it is stored under the `Referer` header.
How to get HttpContext.Current in ASP.NET Core
By Tan Lee Published on Dec 27, 2024 1.2K
In ASP.NET Core, `HttpContext.Current` was removed. Instead, `HttpContext` is injected into services, controllers, and middleware via dependency injection, and can be accessed using the `IHttpContextAccessor` interface.
How to read Configuration Values from appsettings.json in ASP.NET Core
By Tan Lee Published on Dec 27, 2024 1.37K
To access the values from the configuration file, you need to set up a configuration system in the Startup.cs class.
How to add link parameter to asp tag helpers in ASP.NET Core
By Tan Lee Published on Dec 27, 2024 1.27K
You can use the asp-route- attribute prefix to specify route parameters in ASP.NET Core tag helpers.
How to Remove ASP.NET server headers
By Tan Lee Published on Dec 27, 2024 497
IIS (Internet Information Services) web server sometimes sends HTTP headers that can disclose sensitive server information.