EF Mapping to prefix all column names within a tab

2020-07-21 06:15发布

问题:

I have a large existing database which has a convention where all the column names are prefixed with the de-pluralised tablename, e.g.

Tablename: addresses
Columns:
    addressId
    addressLine1
    addressLine2

Is there any configuration I can apply for a mapping (using the fluent API) where I can specify that all column names are prefixed with a string e.g. "address"? Otherwise I will need to define every single column mapping, which seems a bit of a pain.

What would be even better is if I could write a convention where the prefix is automatically set from the de-pluralised tablename, but I am aware that custom conventions are not supported at this point, so I guess this is even less feasible.