- C# Insights
- Posts
- 🚀 Command Pattern In C# - What You Need To Implement It
🚀 Command Pattern In C# - What You Need To Implement It
Hi! ✌️
Explore the power of the Command Pattern in C#, a behavioral design pattern that enhances code organization and flexibility. Learn key components like Invoker, Command, Concrete Command, and Receiver, and follow a practical guide to implement the pattern in C#. Discover benefits such as improved code organization and maintainability, along with potential drawbacks like increased complexity.
In this blog post, Milan Jovanović shares 5 powerful C# refactoring tips through the lens of refactoring a poorly written CustomerService class. Learn about improving code readability, testability, and maintainability by applying techniques such as extracting methods, introducing dependency injection, and pushing logic down into the domain model.
In optimizing .NET code, the author explores the impact of LINQ on performance and memory efficiency using an Advent of Code puzzle. While LINQ may introduce negligible overhead in many cases, removing it significantly improves both performance and memory allocation, illustrating considerations for performance-critical scenarios.
Learn to boost string performance in Microsoft .NET by switching from Substring to AsSpan. In benchmark results, AsSpan outperforms Substring by 44.6 times, with zero allocations.
Explore the latest enhancements in Entity Framework Core 6.0 with ExecuteUpdate and ExecuteDelete methods, streamlining batch update and delete operations. Discover how these methods revolutionize data manipulation, providing direct, efficient database-level execution and significantly improving performance, especially in large-scale operations. Dive into ExecuteUpdate's capabilities and considerations, witnessing EF Core's commitment to simplifying and optimizing developers' data tasks.
Explore ASP.NET Core's StringValues, a versatile readonly struct efficiently handling zero, one, or many strings. Delve into its implementation, striking a balance between performance and simplicity, offering a solution to the challenges posed by headers with multiple values in HTTP requests and responses.
This blog post delves into enhancing ASP.NET Core authentication security by addressing two key issues. Firstly, it discusses the challenge of managing large cookies, especially when integrating OpenID Connect. Secondly, it highlights a security concern regarding cookie persistence after user sign-out and proposes a solution—implementing a session store to reduce cookie size and enhance security by automatically removing stored entries at sign-out.
Learn how to efficiently insert binary files into SQL-Server tables using C# and SqlClient classes, exploring options such as FILESTREAM and varbinary(MAX) column types. The article also discusses considerations for choosing between database and file system storage, providing well-structured code samples for single and multiple file operations.
Explore the latest Visual Studio productivity features introduced in 2023, enhancing your coding experience. Highlights include Spell Checker, All-In-One Search, Markdown editing, Brace Pair Colorization, Sticky Scroll, Compare Files, Copy and Trim Indentation, Case-preserving Find and Replace, and Summary Diff.
Reply