Question

We have a legacy system which has the ability to add custom fields to its entites. This feature is implemented badly, to be exact: each entity table is extended with fields Custom1, ... Custom 10, and moreover, there's big table CustomFields (EntityType, EntityID, Custom11, ... Custom99), where EntityType is entity table's name.

We are building new code on top of the existing bad database and are searching for the possibilities to put all these Customs into a single dictionary when materializing. The ORMs we consider currently are BLToolkit and EF4 (the former is in use now, we are planning to move to the latter).

Is there a possibility to implement this kind of mapping with either of two? Maybe some other ORM (probably, we'd like heavy ORM) might help? Or, there's a best practice of another kind?

Was it helpful?

Solution

Well, after a bit of investigation and discussions we've decided to introduce XML field in the entity table that contains the values of all custom fields. The field value is synchronized with actual custom field values in both directions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top