software-design-patterns
C# Design Patterns Tutorial Sample Code (by garywoodfine)
SmartEnum
A base class for quickly and easily creating strongly typed enum replacements in C#. (by ardalis)
software-design-patterns | SmartEnum | |
---|---|---|
1 | 7 | |
95 | 2,055 | |
- | - | |
0.0 | 8.1 | |
about 2 years ago | 6 days ago | |
C# | C# | |
GNU General Public License v3.0 only | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
software-design-patterns
Posts with mentions or reviews of software-design-patterns.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2021-05-18.
-
The Mediator Pattern
I will not discuss the whole process of setting up the project to use these libraries because the source code is for this example is available. For the purpose of this article we will only discuss the Mediator pattern implementation.
SmartEnum
Posts with mentions or reviews of SmartEnum.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-07-06.
- Java or C# for backed
-
Is there a "right" way to consolidate constants in C#/.NET?
I agree SmartEnum is my go-to for this
-
best practice to create a method with params of limited values
If we knew more about these methods and what kinds of parameters they take we could maybe make some suggestions. There are some patterns like smart enum that are sometimes just the thing.
-
Smart Enums In C# Like Java
In C# I am not able to add constructors, properties, and methods. although there is a library to do this https://github.com/Ardalis/SmartEnum but wouldn't be nice if we have this feature built-in to C#.
- What is it about C# that you do NOT like compared to other languages?
-
Displaying Enums with custom value
You can use the SmartEnum library.
- C# records can be used to emulate Java's fancy enums.
What are some alternatives?
When comparing software-design-patterns and SmartEnum you can also consider the following projects:
MediatR - Simple, unambitious mediator implementation in .NET
Enums.NET - Enums.NET is a high-performance type-safe .NET enum utility library
Result - A result abstraction that can be mapped to HTTP response codes if needed.
SmartAnnotations - A library for .NET that uses source generators to automatically generate data annotations for your models.
DesignPatternsLibrary - A comprehensive design patterns library implemented in C#, which covers various design patterns from the most commonly used ones to the lesser-known ones. Get familiar with and learn design patterns through moderately realistic examples.
csharplang - The official repo for the design of the C# programming language