EntityFrameworkCore.Generator
EntityFrameworkCore.Generator copied to clipboard
Add support for table prefix
Table in database: t_User
Generated class now: public class tUser
Expected output: public class User
I have made a pull request for this feature:
https://github.com/loresoft/EntityFrameworkCore.Generator/pull/339
A pattern will be used to extract the entity name and optionally apply a prefix or suffix. For example, if the table name is "tblEmployees", the pattern ^tbl(?<ClassName>.*?)$
will extract "Employees"
The extracted name can be prefixed or suffixed further.
To match all tables and apply a prefix, one might use the pattern ^.*?$
.
example configuration in generation.yml
under data > entity
entityNamingFilters:
- pattern: ^tbl(?<ClassName>.*?)$
prefix:
suffix:
- pattern: ^vw(?<ClassName>.*?)$
prefix:
suffix: View
In your case the configuration would be
entityNamingFilters:
- pattern: ^t_(?<ClassName>.*?)$