❔ Designing an api that can create "fields" with different values
Hi, so I am creating a feature in my API where the user can create kind of a Form, and the user can create some fields with different value types. The field types are bool, string, date, decimal, and a list, where the important things are the name. The thing i find difficult is how to store the different values in the best way.
I have several different thought, ranging from every field type having it's own class, inheriting from one Field class with common properties, to just store it in one class type, and shoving every possible type in a string, and having an enum tell me what type it is, and just convert it back. This will make it hard to make any search meaningful however. Last thought i had is to have one class type and having it have a BoolValue, StringValue and so on.
I feel like there is some better OOP way to do this that i ain't seeing. This also needs to work with Entity Framework