Question: I would like to have a list of enum values with extended data. The database will only save an integer value corresponding to my enum value, but in code I would like to have more information than just the enum name.

Let me give you an example:

```
public enum Reason
{
    NotEnoughStock, // Valid = yes, Responsability = company, Text = There is not enough stock
    ProductNotAvailabe, // Valid = no, Responsability = company, Text = Produc is not available
    PaymentNotDone, // Valid = no, Responsability = client, Text = Payment is not done
    BlackListedClient, // Valid = no, Responsability = client, Text = Client is black listed
    NotEnoughTime // Valid = yes, Responsability = company, Text = There is not enough time
}

```

How can I do that? Should I use something else than an enum? I like the enumeration.

Answer: 
You could:

* use [Attributes (C#)](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/attributes/); or
* create helper class that returns the extra information, via something like `Helper.GetExtraInfo(MyType val)`.

---

For the '*Text*' value you could use [DescriptionAttribute](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.descriptionattribute?view=netframework-4.8).
For the other two I think you should create new attributes. 

```
class ValidAttribute : Attribute
{
    public bool Valid { get; private set; }

    public ValidAttribute(bool valid)
    {
        this.valid = valid;
    }
}

```

[Get enum from enum attribute](https://stackoverflow.com/questions/2787506/get-enum-from-enum-attribute) contains an extension method to read values of attributes.
Create a class to store other information e.g `ReasonDetail`, then use `Dictionary<Reason, ReasonDetail>` and provide the mapping between the `Reason` and `ReasonDetail`