Fading Coder

One Final Commit for the Last Sprint

Exporting Generic Lists to Excel Files with NPOI in ASP.NET

Exporting Generic Lists to Excel Files with NPOI in ASP.NET NPOI is a powerful .NET library that allows developers to create and manipulate Microsoft Excel files without requiring Excel to be installed on the server. This guide demonstrates how to convert a generic list to an Excel file and save it...

Dynamic Type Instantiation and Runtime Inspection in C#

When building extensible console utilities, hard-coding instantiation logic with switch blocks forces modifications for every new implementation. Consider a scenario requiring dynamic creation of derived types based on user input without recompiling the host application. A base type Organism defines...

Common Pitfalls and Solutions When Using XmlReader and XmlWriter in .NET

When processing XML files larger than 100MB, using XmlDocument to load the entire file into memory becomes inefficient, leading to high memory consumption and long processing times. In such scenarios, switching to XmlReader and XmlWriter for stream-based processing offers significant performance ben...

Core C# Concepts: Arrays, Multithreading, Internal Access, LINQ, and HttpClient

C# Arrays Arrays in C# are fixed-size data structures that store elements of the same type. They are declared with a specific size and type. int[] numbers = new int[] { 10, 20, 30, 40, 50 }; int first = numbers[0]; int count = numbers.Length; C# Multithreading Multithreading enables concurrent execu...

Constructing Dynamic Query Conditions in C# Using Expression Trees for FreeSql

When building data access layers, a common requirement is togggling between exact match and fuzzy search for string fields based on front-end input. Instead of writting two separate conditional branches for each filter, a reusable helper can encapsulate either equality or containment logic. Directly...

Practical Techniques for File Operations and Data Serialization in C#

File-based storage is optimal for managing substantial volumes of data with simple relationships, such as application logs, offering accessibility across various storage media. The .NET framework provides stream-based APIs for file interaction. Common File and Directory Operations Obtain the current...

Core Sorting Algorithms and Lua Patterns for Unity Engineers

Bubble Sort Implementation This algorithm iterates through the dataset multiple times, swapping adjacent elements if they are in the wrong order. An optimization flag is included to terminate early if the list becomes sorted before all passes complete. public static void ExecuteBubbleSortion(int[] d...

Mastering Task-Based Asynchronous Programming in C#

Understanding Task Parallel Library Fundamantals Task Parallel Library (TPL) addresses critical limitations of traditional thread pool usage. While thread pools optimize resource utilizasion by abstracting thread management complexities, they present challenges in result retrieval, exception propaga...

Core Object-Oriented Design Principles in C#

1. Single Responsibility Principle (SRP)The Single Responsibility Principle states that a class should have only one reason to change. In practical terms, this means a module should be responsible for a single functional area or logic within the application. This principle serves as a foundation for...

Fixing Permission Check Errors in NFine When Switching Tabs

When logging into NFine (except with the admin account, which bypasses permisions), clicking on Menu 1 opens Window 1, and clicking on Menu 2 opens Window 2. However, when switching back to Window 1 and performing an operation, no permissions are detected. Debugging reveals the issue in the HandlerA...