ardalis / ardalis/SmartEnum

parameterless constructor

Open
#103 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
C#
Stars
2.4k
Forks
184
PR merge metrics
No merged PRs in 30d

Description

Commit #16's parameterless constructor is not in the source code anymore. Is there a reason for this?

In order to put the smartEnum into a EF Core Table, now I need to do the following for the constructor
```
// base("default", "default") should not be needed. and it adds confusion for programmer I think.
protected BaseOptionType() : base("default", "default")
{
IsRequired = false;
}
```
[EF Core Value Conversions](https://github.com/ardalis/SmartEnum#persisting-with-ef-core-21-or-higher) does not work for me, because I do want to save both name and value into the database, so user can add record to it later as well.

related issues
#16
#15

Contributor guide

Open the contributing guide

Research direction

Start by reviewing related issues #16 and #15 and the linked EF Core Value Conversions documentation. Determine how SmartEnum persistence should support storing both name and value without the workaround constructor; done means the requested parameterless-constructor behavior is supported and covered by appropriate tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.