Useful design-time features for the Code First Development. Generate Entities, DbContext and Fluent mapping classes. Based on Razor templates. An extension allows to completely customize the generation behavior in the design-time.
Useful design-time features for the Code First Development. Generate Entities, DbContext and Fluent mapping classes. Based on Razor templates. An extension allows to completely customize the generation behavior in the design-time.
Features at a glance
Easy use.
Customize the entity generation behavior.
Allows customization:
Table selection, including tables by table name, schema name, regular expression or use existing edmx file.
Namespace.
File name.
Base class.
Enabling/Disabling generation as partial classes.
Plural/Singular generated entities.
Converting to Pascal Case.
Replacing names by regex
Enabling/Disabling generation of navigation properties.
Changing of a one-to-many or many-to-many navigation property type.
Customize the DbContext generation behavior.
Allows customization:
Generating more than one DbContext classes with a different table selection.
Class name.
Namespace, entities namespace.
Base class.
Enabling/Disabling generation as partial classes.
File name.
Supporting generation of read-only properties of a DbContext class.
Supporting IDbSet interface properties.
Fluent mapping.
Allows use the existing edmx file for creating table selection.
Connection management.
Allows the customization of a connection string in several ways:
Connection name.
Take a connection name from app.config of an application or any other config file.
Connection string.
Used with a connection string defined in the settings file.
Exposes the code generation templates based on the Razor syntax.
Provides Visual Studio IntelliSense of a configuration file
Free
Open for feedback.
Overview
Flexible Entity Framework Generator allows to generate Entities, DbContext and Fluent mapping classes from an existing database in the development design-time. Entities and Fluent mapping classes are stored together in a single file and DbContext class is stored in a separate class. An extension allows the creation of more than one DbContext classes, based on different table selections.
A table selection can be created in following ways :
Use existings edmx file of the Entity Framework. An extention load edmx file and use the SSDL section of the file.
Including tables by table or chema name.
Including tables by regular expression.
Metadata that describes "what,from" and "to" is stored in the special configuration file, that has efconfig.xml extension. Flexible Entity Framework Generator has a command that creates a configuration file with default settings. Provides Visual Studio IntelliSence and helpful comments in a file, allowing the easy creation of any generation configuration.
A default configuration file generated by Flexible Entity Framework Generator has the following settings:
A Model is generated for all tables in the database.
Entities are stored in the Entities.generated.cs file
A DbContext class name is DbManager.
DbContext is stored in the DbManager.generated.cs file
The following parameters are taken from the project context where the configuration efconfig.xml file has been saved.
Namespace of entities and DbContext is initialized from a default namespace of the project.
Connection name is initialized from a connection string section of the app.config when only one connection string is present in the project.
Getting Starting
Right clicking on project or folder in the Solution Explorer and select the Add Config File.
Right clicking on generated Default.efconfig.xml file and select Generate Model menu item. If a connection is not provided in the default config file, the Connection pop-up is opened that allows database selection.
Code First model has generated.
Customize Templates
Right click on project or folder in the Solution Explorer and select the Add Entities Template or Add DbContext template.
Add a new template file into settings file.
Revision Notes
0.7.2
Added : MS-PL License
Added : Ability to exclude db views
1.0.0.0
Added : Ability to use the existing edmx file for creating table selection.
1.0.0.1
Added : Table name's transformation by regex replace.