Comments (5)
I wasn't applying tags until this version, sorry. Do you have an example of a non-struct TValue you could share?
from smartenum.
Hi Ardalis, 1.0.5 doesn't have the struct constraint on TValue.
Seems it was introduced here: 1c9bf3e#diff-b71ca71881242d3857a980ff13d4309dR34
from smartenum.
Right, that was a major PR introduced by @aalmada which had a big positive perf impact. What negative impact are you seeing from the constraint? What scenario is it limiting?
Remember SmartEnum's primary goal is replacing the standard enum
type and making it better by having each option be a class rather than a primitive. A standard enum
can only be a very short list of types:
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/enum
The approved types for an enum are byte, sbyte, short, ushort, int, uint, long, or ulong.
from smartenum.
Thanks. I was using it with string
values.
I don't have a large codebase depending on SmartEnum and string as a value so I can get away with refactoring the code.
from smartenum.
Ok, thanks. Of course if you stick with 1.0.5 you should be fine, too. Unless I hear that this is breaking a lot of other people, though, I think I'm fine to have SmartEnum expect a struct Value going forward.
from smartenum.
Related Issues (20)
- Deserialization of appsettings.json via ConfigurationBuilder doesn't work HOT 1
- EF Core 7 InMemory - Throwing System.ArgumentException with any query involving a SmartEnum HOT 3
- README Example does not compile
- Case Insensitive String Enum HOT 1
- Enable Discussions for repo
- Loading SmartEnum from Entity Framework without specifying it as a static property
- Not compatible with .Net 6 HOT 1
- SmartFlagEnum does not support values larger than int.MaxValue HOT 1
- Need simple method to get single int value from existing IEnumerable<MyFlagEnum>. HOT 5
- SmartEnum binding to [FromQuery] parameters HOT 3
- Ordering the values
- Can/should SmartEnum implement the non-generic IComparable interface?
- SmartEnumStringComparer not included in 7.0.0 version HOT 2
- Add a ValidationAttribute to Validate Model Property Against SmartEnum Names
- ushort error in SmartFlagEnumValueConverter HOT 1
- For the README.md I found out that the path for TestEnum.cs is broken HOT 1
- Add Description attribute HOT 1
- Please Release Version for .NET 8.0 HOT 3
- Are you open to a PR for a nullable `Name`? HOT 2
- Add a way to enumerate over the List to prevent allocation every time List is called HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smartenum.