The Memento Pattern in C# – How to Achieve Effortless State Restoration
Looking to implement the Memento Pattern in C#? Learn about its origin and principles, and the different components & steps to implementation!
These are programming specific articles that will be published to CodeProject. They should be complete tutorials with code examples for you to use!
Looking to implement the Memento Pattern in C#? Learn about its origin and principles, and the different components & steps to implementation!
Organize your code with the Command Pattern in C#! Learn what the Command Pattern in C# is and the design principles it follows. Understand the pros and cons!
Learn about the pipeline design pattern in C#. Discover how to create and chain pipeline stages. Get code examples, tips, and use cases for this design pattern.
Check out this example vertical slice architecture in ASP.NET core! Together we'll look at building a flight booking app using vertical slice architecture.
Check our these examples of the observer pattern in C#! Learn how the observer pattern in C# can simplify the usage of events in your next project!
Let's dive into the plugin architecture design pattern, exploring how it can be leveraged in ASP.NET Core to create more flexible and maintainable applications.
The facade pattern is useful for hiding complexity by moving dependencies behind an API. Let's dive into the facade design pattern in C# in this article!
I wanted to create a follow-up post in my series on IEnumerables, iterators, and collections focusing on performance characteristics. When checking out the runtime performance and memory characteristics between these materialized collections and iterator benchmarks, I was very surprised! Check out this article for performance benchmark characteristics and some curious finds.
In C# 9.0 we received access to a great quality of life type called the record. You can read more about that from Microsoft here. Record types allowed us as dotnet programmers to skip a lot of boiler plate code, thereby saving us time and making code more readable. Wins all around! Before record types, we might have simple data transfer objects (called DTOs) that would look something like the following: public sealed class MyData { public MyData( string value1, int value2) { Value1 = value1; Value2 = value2; } publc string Value1 { get; } publc int Value2 { get; } } And for a simple class with two properties... I think we can all agree that the verbosity here is just over the top. With the record type that we were given access to, we can now write…
(This article is intended to be a spiritual successor to this previous entry, and now includes Tasks!) Even if you're new to C#, you've probably come across at least one of Tasks, Threads, or BackgroundWorkers. With a bit of additional time, it's likely you've seen all three in your journey. They're all ways to run concurrent code in C# and each has its own set of pros and cons. In this article, we will explore how each one operates at a high level. It's worth noting that in most modern .NET applications and libraries you'll see things converging to Tasks. The Approach I've gone ahead and created a test application that you can find here. Because this is in source control, it's possible/likely that it will diverge from what we see in this article, so I just wanted to offer…