{ "$schema": "http://json-schema.org/draft-04/schema#", "$id": "http://example.com/example.json", "type": "object", "default": {}, "title": "Configuration for EF Core Power Tools", "markdownDescription": "See a full feature guide in [the wiki](https://github.com/ErikEJ/EFCorePowerTools/wiki/Reverse-Engineering)", "required": [ "tables", "code-generation", "names", "file-layout" ], "properties": { "tables": { "type": "array", "default": [], "title": "List of tables discovered in the source database", "items": { "type": "object", "title": "Table", "properties": { "name": { "type": "string", "title": "Full table name", "examples": [ "[dbo].[Categories]", "Oldtable" ] }, "exclude": { "type": "boolean", "default": null, "title": "Set to true to exclude this table from code generation", "examples": [ true ] }, "exclusionWildcard": { "type": "string", "title": "Exclusion pattern with * symbol, use '*' to exclude all by default", "examples": [ "*" ] }, "excludedColumns": { "type": "array", "default": [], "title": "Columns to Exclude from code generation", "items": { "type": "string", "title": "Column", "examples": [ "Name", "Email" ] }, "examples": [ [ "Name", "Email" ] ] }, "excludedIndexes": { "type": "array", "default": [], "title": "Indexes to Exclude from code generation", "items": { "type": "string", "title": "Index", "examples": [ "UX_Parent_ChildId_TopLevel", "IX_WidgetId" ] }, "examples": [ [ "UX_Parent_ChildId_TopLevel", "IX_WidgetId" ] ] } }, "examples": [{ "name": "[dbo].[Categories]" }, { "name": "Oldtable", "exclude": true }] }, "examples": [ [{ "name": "[dbo].[Categories]" }, { "name": "Oldtable", "exclude": true }] ] }, "views": { "type": "array", "default": [], "title": "List of views discovered in the source database", "items": { "type": "object", "title": "View", "properties": { "name": { "type": "string", "title": "Full view name", "examples": [ "[dbo].[Categories]", "[dbo].[CustomerCustomerDemo]" ] }, "exclude": { "type": "boolean", "default": false, "title": "Set to true to exclude this view from code generation", "examples": [ true ] }, "exclusionWildcard": { "type": "string", "title": "Exclusion pattern with * symbol, use '*' to exclude all by default", "examples": [ "*" ] }, "excludedColumns": { "type": "array", "default": [], "title": "Columns to Exclude from code generation", "items": { "type": "string", "title": "Column", "examples": [ "Name", "Email" ] }, "examples": [ [ "Name", "Email" ] ] } }, "examples": [{ "name": "[dbo].[Categories]" }, { "name": "[dbo].[CustomerCustomerDemo]", "exclude": true }] }, "examples": [ [{ "name": "[dbo].[Categories]" }, { "name": "[dbo].[CustomerCustomerDemo]", "exclude": true }] ] }, "stored-procedures": { "type": "array", "default": [], "title": "List of stored procedures discovered in the source database", "items": { "type": "object", "title": "Stored procedure", "properties": { "name": { "type": "string", "title": "The stored procedure name", "examples": [ "[dbo].[Alphabetical list of products]", "[dbo].[Category Sales for 1997]" ] }, "exclude": { "type": "boolean", "default": false, "title": "Set to true to exclude this stored procedure from code generation", "examples": [ true ] }, "use-legacy-resultset-discovery": { "type": "boolean", "default": false, "title": "Use sp_describe_first_result_set instead of SET FMTONLY for result set discovery", "examples": [ true ] }, "mapped-type": { "type": "string", "default": null, "title": "Name of an entity class (DbSet) in your DbContext that maps the result of the stored procedure ", "examples": [ "Customer" ] }, "exclusionWildcard": { "type": "string", "title": "Exclusion pattern with * symbol, use '*' to exclude all by default", "examples": [ "*" ] } }, "examples": [{ "name": "[dbo].[Alphabetical list of products]" }, { "name": "[dbo].[Category Sales for 1997]", "use-legacy-resultset-discovery": true, "mapped-type": "Customer" }] }, "examples": [ [{ "name": "[dbo].[Alphabetical list of products]" }, { "name": "[dbo].[Category Sales for 1997]", "use-legacy-resultset-discovery": true, "mapped-type": "Customer" }] ] }, "functions": { "type": "array", "default": [], "title": "List of scalar and TVF functions discovered in the source database", "items": { "type": "object", "title": "Function", "properties": { "name": { "type": "string", "title": "Name of function", "examples": [ "[dbo].[FunctionA]", "[dbo].[FunctionB]" ] }, "exclude": { "type": "boolean", "default": false, "title": "Set to true to exclude this function from code generation", "examples": [ true ] }, "exclusionWildcard": { "type": "string", "title": "Exclusion pattern with * symbol, use '*' to exclude all by default", "examples": [ "*" ] } }, "examples": [{ "name": "[dbo].[FunctionA]" }, { "name": "[dbo].[FunctionB]" }] }, "examples": [ [{ "name": "[dbo].[FunctionA]" }, { "name": "[dbo].[FunctionB]" }] ] }, "code-generation": { "type": "object", "default": {}, "title": "Options for code generation", "required": [ "enable-on-configuring", "type", "use-database-names", "use-data-annotations", "use-nullable-reference-types", "use-inflector", "use-legacy-inflector", "use-many-to-many-entity", "use-t4", "remove-defaultsql-from-bool-properties", "soft-delete-obsolete-files", "use-alternate-stored-procedure-resultset-discovery" ], "properties": { "enable-on-configuring": { "type": "boolean", "default": false, "title": "Add OnConfiguring method to the DbContext", "examples": [ false ] }, "type": { "type": "string", "default": "all", "title": "Type of files to generate", "enum": ["all", "dbcontext", "entities"], "examples": [ "all" ] }, "use-database-names": { "type": "boolean", "default": false, "title": "Use table and column names from the database", "examples": [ false ] }, "use-data-annotations": { "type": "boolean", "default": false, "title": "Use DataAnnotation attributes rather than the fluent API (as much as possible)", "examples": [ false ] }, "use-nullable-reference-types": { "type": "boolean", "default": true, "title": "Use nullable reference types", "examples": [ true ] }, "use-inflector": { "type": "boolean", "default": false, "title": "Pluralize or singularize generated names (entity class names singular and DbSet names plural)", "examples": [ false ] }, "use-legacy-inflector": { "type": "boolean", "default": false, "title": "Use EF6 Pluralizer instead of Humanizer", "examples": [ false ] }, "use-many-to-many-entity": { "type": "boolean", "default": false, "title": "Preserve a many to many entity instead of skipping it ", "examples": [ false ] }, "use-t4": { "type": "boolean", "default": false, "title": "Customize code using T4 templates", "examples": [ false ] }, "use-t4-split": { "type": "boolean", "default": false, "title": "Customize code using T4 templates including EntityTypeConfiguration.t4. This cannot be used in combination with use-t4 or split-dbcontext-preview", "examples": [ false ] }, "t4-template-path": { "type": [ "string", "null" ] , "default": null, "title": "Global path to T4 templates" }, "remove-defaultsql-from-bool-properties": { "type": "boolean", "default": false, "title": "Remove SQL default from bool columns to avoid them being bool?", "examples": [ false ] }, "soft-delete-obsolete-files": { "type": "boolean", "default": false, "title": "Run Cleanup of obsolete files", "examples": [ false ] }, "discover-multiple-stored-procedure-resultsets-preview": { "type": "boolean", "default": false, "title": "Discover multiple result sets from SQL stored procedures (preview)", "examples": [ false ] }, "use-alternate-stored-procedure-resultset-discovery": { "type": "boolean", "default": false, "title": "Use alternate result set discovery - use sp_describe_first_result_set to retrieve stored procedure result sets", "examples": [ false ] }, "use-no-navigations-preview": { "type": "boolean", "default": false, "title": "Remove all navigation properties from the generated code (preview)", "examples": [ false ] }, "merge-dacpacs": { "type": "boolean", "default": false, "title": "Merge .dacpac files (when using .dacpac references)", "examples": [ false ] }, "generate-mermaid-diagram": { "type": "boolean", "default": false, "title": "Create a markdown file with a Mermaid ER diagram during scaffolding", "examples": [ false ] }, "refresh-object-lists": { "type": "boolean", "default": true, "title": "Refresh the lists of objects (tables, views, stored procedures, functions) from the database in the config file during scaffolding", "examples": [ false ] }, "use-prefix-navigation-naming": { "type": "boolean", "default": true, "title": "Use prefix based naming of navigations with EF Core 8 or later", "examples": [ false ] } }, "examples": [{ "enable-on-configuring": false, "type": "all", "use-database-names": false, "use-data-annotations": false, "use-nullable-reference-types": true, "use-inflector": false, "use-legacy-inflector": false, "use-many-to-many-entity": false, "use-t4": false, "remove-defaultsql-from-bool-properties": false, "soft-delete-obsolete-files": false, "discover-multiple-stored-procedure-resultsets-preview": false, "use-alternate-stored-procedure-resultset-discovery": false, "use-no-navigations-preview": false, "merge-dacpacs": false, "refresh-object-lists": true }] }, "names": { "type": "object", "default": {}, "title": "Custom class and namespace names", "required": [ "dbcontext-name", "root-namespace" ], "properties": { "dbcontext-name": { "type": "string", "default": "", "title": "Name of DbContext class", "examples": [ "NorthwindContext" ] }, "dbcontext-namespace": { "type": [ "string", "null" ] , "default": null, "title": "Namespace of DbContext class", "examples": [ null ] }, "model-namespace": { "type": [ "string", "null" ] , "default": null, "title": "Namespace of entities", "examples": [ null ] }, "root-namespace": { "type": "string", "title": "Root namespace", "examples": [ "MyProect" ] } }, "examples": [{ "root-namespace": "MypProject", "dbcontext-name": "NorthwindContext" }] }, "file-layout": { "type": "object", "default": {}, "title": "Custom file layout options", "required": [ "output-path" ], "properties": { "output-path": { "type": "string", "default": "Models", "title": "Output path", "examples": [ "Models" ] }, "output-dbcontext-path": { "type": [ "string", "null" ], "default": null, "title": "DbContext output path", "examples": [ "Data" ] }, "split-dbcontext-preview": { "type": "boolean", "default": false, "title": "Split DbContext (preview)", "examples": [ false ] }, "use-schema-folders-preview": { "type": "boolean", "default": false, "title": "Use schema folders (preview)", "examples": [ false ] }, "use-schema-namespaces-preview": { "type": "boolean", "default": false, "title": "Use schema namespaces (preview)", "examples": [ false ] } }, "examples": [{ "output-path": "Models", "output-dbcontext-path": "Context", "split-dbcontext-preview": false, "use-schema-folders-preview": false, "use-schema-namespaces-preview": false }] }, "type-mappings": { "type": "object", "default": {}, "title": "Optional type mappings", "properties": { "use-DateOnly-TimeOnly": { "type": "boolean", "default": false, "title": "Map date and time to DateOnly/TimeOnly (mssql)", "examples": [ true ] }, "use-HierarchyId": { "type": "boolean", "default": false, "title": "Map hierarchyId (mssql)", "examples": [ true ] }, "use-spatial": { "type": "boolean", "default": false, "title": "Map spatial columns", "examples": [ true ] }, "use-NodaTime": { "type": "boolean", "default": false, "title": "Use NodaTime", "examples": [ true ] } }, "examples": [{ "use-DateOnly-TimeOnly": true, "use-HierarchyId": true, "use-spatial": true, "use-NodaTime": false }] }, "replacements": { "type": "object", "default": {}, "title": "Custom naming options", "properties": { "preserve-casing-with-regex": { "type": "boolean", "default": false, "title": "Preserve casing with regex when custom naming", "examples": [ false ] }, "uncountable-words": { "type": "array", "default": [], "title": "Uncountable (ignored) words for Humanizer", "items": { "type": "string", "title": "Word list", "examples": [ "Status", "Data" ] }, "examples": [ ["Status", "Data" ] ] } }, "examples": [{ "preserve-casing-with-regex": false, "uncountable-words": [ "Status", "Data" ] }] } }, "examples": [{ "tables": [{ "name": "[dbo].[Categories]" }, { "name": "[dbo].[CustomerCustomerDemo]", "excludedColumns": ["Name", "Email"] }, { "name": "[dbo].[Oldtable]", "exclude": true }], "views": [{ "name": "[dbo].[Categories]" }, { "name": "[dbo].[CustomerCustomerDemo]", "excludedColumns": ["Name", "Email"] }], "stored-procedures": [{ "name": "[dbo].[Alphabetical list of products]" }, { "name": "[dbo].[Category Sales for 1997]", "use-legacy-resultset-discovery": true, "mapped-type": "Customer" }], "functions": [{ "name": "[dbo].[FunctionA]" }, { "name": "[dbo].[FunctionB]" }], "code-generation": { "enable-on-configuring": false, "type": "all", "use-database-names": false, "use-data-annotations": false, "use-nullable-reference-types": true, "use-inflector": false, "use-legacy-inflector": false, "use-many-to-many-entity": false, "use-t4": false, "remove-defaultsql-from-bool-properties": false, "soft-delete-obsolete-files": false, "discover-multiple-stored-procedure-resultsets-preview": false, "use-alternate-stored-procedure-resultset-discovery": false, "refresh-object-lists": true }, "names": { "root-namespace": "MyProject", "dbcontext-name": "NorthwindContext", "dbcontext-namespace": null, "model-namespace": null }, "file-layout": { "output-path": "Models", "output-dbcontext-path": null, "split-dbcontext-preview": false, "use-schema-folders-preview": false, "use-schema-namespaces-preview": false }, "type-mappings": { "use-DateOnly-TimeOnly": false, "use-HierarchyId": false, "use-spatial": false, "use-NodaTime": false }, "replacements": { "preserve-casing-with-regex": false, "uncountable-words": [ "Status", "Data" ] } }] }