ardalis / ardalis/SmartEnum

`SmartEnumNameConverter` does not support `Guid` values

Open
#561 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
2.4k
Forks
184
PR merge metrics
No merged PRs in 30d

Description

I am using SmartEnums with Guid's as underlying values.
This works great except for when I want to serialize the names to JSON. In `SmartEnumNameConverter` there is a restriction placed on `TValue`, specifically `IConvertible`.
When I add a copy of the class to my solution and simply remove this restriction it works fine.

Is there a reason this restriction is added?

Contributor guide

Open the contributing guide

Research direction

Start at SmartEnumNameConverter and trace why TValue is constrained to IConvertible; compare its Guid serialization path with existing supported values. Done means the converter supports name serialization for Guid-backed SmartEnums while preserving current behavior for other underlying values, with regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.