We have a requirement on our project for custom fields. We have some standard fields on the table and each customer wants to be able to add their own custom fields. At the moment I am not interested in how this will work in the UI, but I want to know what the options are for the back end storage and retrieval of the data. The last time I did something like this was about 10 years ago in VB6 so I would be interested to know what the options are for this problem in today’s .Net world.
The project is using SQL server for the backend, linq-to-sql for the ORM and a C# asp.net front end.
What are my options for this?
Thanks
There are four main options here:
Customertable might have aCustomerValuestable with pairs like"dfeeNumber"=12345(one row per custom key/value pair) – but a pain to work with (instead of a “get”, this is a “get” and a “list” per entity)CustomFieldssingle cell – again, not ideal to work with, but it easier to store atomically with the main record (downside: forces you to load all the custom fields to read a single one)I’ve used all 4 at different points. All 4 can work. YMMV.