Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update --table and --schema documentation #4210

Merged
merged 1 commit into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions entity-framework/core/cli/dotnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,20 +211,20 @@ Arguments:

Options:

| Option | Short | Description |
|:-----------------------------------------------|:------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| <nobr>`--data-annotations`</nobr> | <nobr>`-d`</nobr> | Use attributes to configure the model (where possible). If this option is omitted, only the fluent API is used. |
| <nobr>`--context <NAME>`</nobr> | `-c` | The name of the `DbContext` class to generate. |
| <nobr>`--context-dir <PATH>`</nobr> | | The directory to put the `DbContext` class file in. Paths are relative to the project directory. Namespaces are derived from the folder names. |
| <nobr>`--context-namespace <NAMESPACE>`</nobr> | | The namespace to use for the generated `DbContext` class. Note: overrides `--namespace`. |
| <nobr>`--force`</nobr> | `-f` | Overwrite existing files. |
| <nobr>`--output-dir <PATH>`</nobr> | `-o` | The directory to put entity class files in. Paths are relative to the project directory. |
| <nobr>`--namespace <NAMESPACE>`</nobr> | `-n` | The namespace to use for all generated classes. Defaults to generated from the root namespace and the output directory. |
| <nobr>`--schema <SCHEMA_NAME>...`</nobr> | | The schemas of tables to generate entity types for. To specify multiple schemas, repeat `--schema` for each one. If this option is omitted, all schemas are included. |
| <nobr>`--table <TABLE_NAME>...`</nobr> | `-t` | The tables to generate entity types for. To specify multiple tables, repeat `-t` or `--table` for each one. If this option is omitted, all tables are included. |
| <nobr>`--use-database-names`</nobr> | | Use table and column names exactly as they appear in the database. If this option is omitted, database names are changed to more closely conform to C# name style conventions. |
| <nobr>`--no-onconfiguring`</nobr> | | Suppresses generation of the `OnConfiguring` method in the generated `DbContext` class. |
| <nobr>`--no-pluralize`</nobr> | | Don't use the pluralizer. |
| Option | Short | Description |
|:-----------------------------------------------|:------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| <nobr>`--data-annotations`</nobr> | <nobr>`-d`</nobr> | Use attributes to configure the model (where possible). If this option is omitted, only the fluent API is used. |
| <nobr>`--context <NAME>`</nobr> | `-c` | The name of the `DbContext` class to generate. |
| <nobr>`--context-dir <PATH>`</nobr> | | The directory to put the `DbContext` class file in. Paths are relative to the project directory. Namespaces are derived from the folder names. |
| <nobr>`--context-namespace <NAMESPACE>`</nobr> | | The namespace to use for the generated `DbContext` class. Note: overrides `--namespace`. |
| <nobr>`--force`</nobr> | `-f` | Overwrite existing files. |
| <nobr>`--output-dir <PATH>`</nobr> | `-o` | The directory to put entity class files in. Paths are relative to the project directory. |
| <nobr>`--namespace <NAMESPACE>`</nobr> | `-n` | The namespace to use for all generated classes. Defaults to generated from the root namespace and the output directory. |
| <nobr>`--schema <SCHEMA_NAME>...`</nobr> | | The schemas of tables and views to generate entity types for. To specify multiple schemas, repeat `--schema` for each one. If this option is omitted, all schemas are included. If this option is used, then all tables and views in the schemas will be included in the model, even if they are not explicitly included using --table. |
| <nobr>`--table <TABLE_NAME>...`</nobr> | `-t` | The tables and views to generate entity types for. To specify multiple tables, repeat `-t` or `--table` for each one. Tables or views in a specific schema can be included using the 'schema.table' or 'schema.view' format. If this option is omitted, all tables and views are included. |
| <nobr>`--use-database-names`</nobr> | | Use table, view, sequence, and column names exactly as they appear in the database. If this option is omitted, database names are changed to more closely conform to C# name style conventions. |
| <nobr>`--no-onconfiguring`</nobr> | | Suppresses generation of the `OnConfiguring` method in the generated `DbContext` class. |
| <nobr>`--no-pluralize`</nobr> | | Don't use the pluralizer. |

The [common options](#common-options) are listed above.

Expand Down
32 changes: 16 additions & 16 deletions entity-framework/core/cli/powershell.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,22 +213,22 @@ Generates code for a `DbContext` and entity types for a database. In order for `

Parameters:

| Parameter | Description |
|:-----------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| <nobr>`-Connection <String>`</nobr> | The connection string to the database. For ASP.NET Core 2.x projects, the value can be *name=\<name of connection string>*. In that case the name comes from the configuration sources that are set up for the project. This is a positional parameter and is required. |
| <nobr>`-Provider <String>`</nobr> | The provider to use. Typically this is the name of the NuGet package, for example: `Microsoft.EntityFrameworkCore.SqlServer`. This is a positional parameter and is required. |
| <nobr>`-OutputDir <String>`</nobr> | The directory to put entity class files in. Paths are relative to the project directory. |
| <nobr>`-ContextDir <String>`</nobr> | The directory to put the `DbContext` file in. Paths are relative to the project directory. |
| <nobr>`-Namespace <String>`</nobr> | The namespace to use for all generated classes. Defaults to generated from the root namespace and the output directory. |
| <nobr>`-ContextNamespace <String>`</nobr> | The namespace to use for the generated `DbContext` class. Note: overrides `-Namespace`. |
| <nobr>`-Context <String>`</nobr> | The name of the `DbContext` class to generate. |
| <nobr>`-Schemas <String[]>`</nobr> | The schemas of tables to generate entity types for. If this parameter is omitted, all schemas are included. |
| <nobr>`-Tables <String[]>`</nobr> | The tables to generate entity types for. If this parameter is omitted, all tables are included. |
| <nobr>`-DataAnnotations`</nobr> | Use attributes to configure the model (where possible). If this parameter is omitted, only the fluent API is used. |
| <nobr>`-UseDatabaseNames`</nobr> | Use table and column names exactly as they appear in the database. If this parameter is omitted, database names are changed to more closely conform to C# name style conventions. |
| <nobr>`-Force`</nobr> | Overwrite existing files. |
| <nobr>`-NoOnConfiguring`</nobr> | Don't generate `DbContext.OnConfiguring`. |
| <nobr>`-NoPluralize`</nobr> | Don't use the pluralizer. |
| Parameter | Description |
|:------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| <nobr>`-Connection <String>`</nobr> | The connection string to the database. For ASP.NET Core 2.x projects, the value can be *name=\<name of connection string>*. In that case the name comes from the configuration sources that are set up for the project. This is a positional parameter and is required. |
| <nobr>`-Provider <String>`</nobr> | The provider to use. Typically this is the name of the NuGet package, for example: `Microsoft.EntityFrameworkCore.SqlServer`. This is a positional parameter and is required. |
| <nobr>`-OutputDir <String>`</nobr> | The directory to put entity class files in. Paths are relative to the project directory. |
| <nobr>`-ContextDir <String>`</nobr> | The directory to put the `DbContext` file in. Paths are relative to the project directory. |
| <nobr>`-Namespace <String>`</nobr> | The namespace to use for all generated classes. Defaults to generated from the root namespace and the output directory. |
| <nobr>`-ContextNamespace <String>`</nobr> | The namespace to use for the generated `DbContext` class. Note: overrides `-Namespace`. |
| <nobr>`-Context <String>`</nobr> | The name of the `DbContext` class to generate. |
| <nobr>`-Schemas <String[]>`</nobr> | The schemas of tables and views to generate entity types for. If this parameter is omitted, all schemas are included. If this option is used, then all tables and views in the schemas will be included in the model, even if they are not explicitly included using -Table. |
| <nobr>`-Tables <String[]>`</nobr> | The tables and views to generate entity types for. Tables or views in a specific schema can be included using the 'schema.table' or 'schema.view' format. If this parameter is omitted, all tables and views are included. |
| <nobr>`-DataAnnotations`</nobr> | Use attributes to configure the model (where possible). If this parameter is omitted, only the fluent API is used. |
| <nobr>`-UseDatabaseNames`</nobr> | Use table, view, sequence, and column names exactly as they appear in the database. If this parameter is omitted, database names are changed to more closely conform to C# name style conventions. |
| <nobr>`-Force`</nobr> | Overwrite existing files. |
| <nobr>`-NoOnConfiguring`</nobr> | Don't generate `DbContext.OnConfiguring`. |
| <nobr>`-NoPluralize`</nobr> | Don't use the pluralizer. |

The [common parameters](#common-parameters) are listed above.

Expand Down