Skip to content

Commit

Permalink
Get rid of some future warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
smitpatel committed Jul 9, 2020
1 parent e4ae2dc commit 585069a
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 43 deletions.
49 changes: 23 additions & 26 deletions entity-framework/core/miscellaneous/cli/dotnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,10 @@ Entity Framework Core .NET Command-line Tools 2.1.3-rtm-32065
<Usage documentation follows, not shown.>
```


## Updating the tools

Use `dotnet tool update --global dotnet-ef` to update the global tools to the latest available version, if you have the tools installed locally in your project use `dotnet tool update dotnet-ef`. Install a specific version by appending `--version <VERSION>` to your command. See the [Update](/dotnet/core/tools/dotnet-tool-update) section of the dotnet tool documentation for more details.


## Using the tools

Before using the tools, you might have to create a startup project or set the environment.
Expand Down Expand Up @@ -158,7 +156,7 @@ To specify the environment for ASP.NET Core projects, set the **ASPNETCORE_ENVIR

## Common options

| | Option | Description |
| <nobr> </nobr> | Option | Description |
|:------------------|:----------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| | `--json` | Show JSON output. |
| <nobr>`-c`</nobr> | `--context <DBCONTEXT>` | The `DbContext` class to use. Class name only or fully qualified with namespaces. If this option is omitted, EF Core will find the context class. If there are multiple context classes, this option is required. |
Expand All @@ -178,7 +176,7 @@ Drops the database.

Options:

| | Option | Description |
| <nobr> </nobr> | Option | Description |
|:------------------|:-------------------------|:---------------------------------------------------------|
| <nobr>`-f`</nobr> | <nobr>`--force`</nobr> | Don't confirm. |
| | <nobr>`--dry-run`</nobr> | Show which database would be dropped, but don't drop it. |
Expand All @@ -195,10 +193,9 @@ Arguments:

Options:

| | Option | Description |
|:------------------|:-------------------------|:---------------------------------------------------------|
| <nobr> </nobr> | `--connection <CONNECTION>` | The connection string to the database. Defaults to the one specified in `AddDbContext` or `OnConfiguring`. |

| | Option | Description |
|:------------------|:-----------------------------|:-----------------------------------------------------------------------------------------------------------|
| <nobr> </nobr> | `--connection <CONNECTION>` | The connection string to the database. Defaults to the one specified in `AddDbContext` or `OnConfiguring`. |

The following examples update the database to a specified migration. The first uses the migration name and the second uses the migration ID and a specified connection:

Expand Down Expand Up @@ -228,19 +225,19 @@ Arguments:

Options:

| | Option | Description |
|:----------------|:-----------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| <nobr>`-d`</nobr> | `--data-annotations` | Use attributes to configure the model (where possible). If this option is omitted, only the fluent API is used. |
| `-c` | `--context <NAME>` | The name of the `DbContext` class to generate. |
| | `--context-dir <PATH>` | The directory to put the `DbContext` class file in. Paths are relative to the project directory. Namespaces are derived from the folder names. |
| | `--context-namespace <NAMESPACE>` | The namespace to use for the generated `DbContext` class. Note: overrides `--namespace`. (Available from EFCore 5.0.0 onwards.) |
| `-f` | `--force` | Overwrite existing files. |
| `-o` | `--output-dir <PATH>` | The directory to put entity class files in. Paths are relative to the project directory. |
| `-n` | `--namespace <NAMESPACE>` | The namespace to use for all generated classes. Defaults to generated from the root namespace and the output directory. (Available from EFCore 5.0.0 onwards.) |
| | <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. |
| `-t` | `--table <TABLE_NAME>`... | 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. |
| | `--use-database-names` | 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. |
| | `--no-onconfiguring` | Suppresses generation of the `OnConfiguring` method in the generated `DbContext` class. (Available from EFCore 5.0.0 onwards.) |
| <nobr> </nobr> | Option | Description |
|:------------------|:-----------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| <nobr>`-d`</nobr> | `--data-annotations` | Use attributes to configure the model (where possible). If this option is omitted, only the fluent API is used. |
| `-c` | `--context <NAME>` | The name of the `DbContext` class to generate. |
| | `--context-dir <PATH>` | The directory to put the `DbContext` class file in. Paths are relative to the project directory. Namespaces are derived from the folder names. |
| | `--context-namespace <NAMESPACE>` | The namespace to use for the generated `DbContext` class. Note: overrides `--namespace`. (Available from EFCore 5.0.0 onwards.) |
| `-f` | `--force` | Overwrite existing files. |
| `-o` | `--output-dir <PATH>` | The directory to put entity class files in. Paths are relative to the project directory. |
| `-n` | `--namespace <NAMESPACE>` | The namespace to use for all generated classes. Defaults to generated from the root namespace and the output directory. (Available from EFCore 5.0.0 onwards.) |
| | <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. |
| `-t` | `--table <TABLE_NAME>`... | 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. |
| | `--use-database-names` | 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. |
| | `--no-onconfiguring` | Suppresses generation of the `OnConfiguring` method in the generated `DbContext` class. (Available from EFCore 5.0.0 onwards.) |

The following example scaffolds all schemas and tables and puts the new files in the *Models* folder.

Expand All @@ -266,9 +263,9 @@ Arguments:

Options:

| | Option | Description |
|:------------------|:-----------------------------------|:-----------------------------------------------------------------------------------------------------------------|
| <nobr>`-o`</nobr> | <nobr>`--output-dir <PATH>`</nobr> | The directory use to output the files. Paths are relative to the target project directory. Defaults to "Migrations". |
| <nobr> </nobr> | Option | Description |
|:------------------|:---------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------|
| <nobr>`-o`</nobr> | <nobr>`--output-dir <PATH>`</nobr> | The directory use to output the files. Paths are relative to the target project directory. Defaults to "Migrations". |
| <nobr>`-n`</nobr> | <nobr>`--namespace <NAMESPACE>`</nobr> | The namespace to use for the generated classes. Defaults to generated from the output directory. (Available from EFCore 5.0.0 onwards.) |

## dotnet ef migrations list
Expand All @@ -281,7 +278,7 @@ Removes the last migration (rolls back the code changes that were done for the m

Options:

| | Option | Description |
| <nobr> </nobr> | Option | Description |
|:------------------|:----------|:--------------------------------------------------------------------------------|
| <nobr>`-f`</nobr> | `--force` | Revert the migration (roll back the changes that were applied to the database). |

Expand All @@ -298,7 +295,7 @@ Arguments:

Options:

| | Option | Description |
| <nobr> </nobr> | Option | Description |
|:------------------|:------------------|:-------------------------------------------------------------------|
| <nobr>`-o`</nobr> | `--output <FILE>` | The file to write the script to. |
| `-i` | `--idempotent` | Generate a script that can be used on a database at any migration. |
Expand Down
14 changes: 7 additions & 7 deletions entity-framework/core/modeling/entity-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Specific properties can be excluded as follows:

By convention, when using a relational database, entity properties are mapped to table columns having the same name as the property.

If you prefer to configure your columns with different names, you can do so as following:
If you prefer to configure your columns with different names, you can do so as following code snippet:

### [Data Annotations](#tab/data-annotations)

Expand All @@ -48,7 +48,7 @@ When using a relational database, the database provider selects a data type base

For example, SQL Server maps `DateTime` properties to `datetime2(7)` columns, and `string` properties to `nvarchar(max)` columns (or to `nvarchar(450)` for properties that are used as a key).

You can also configure your columns to specify an exact data type for a column. For example the following code configures `Url` as a non-unicode string with maximum length of `200` and `Rating` as decimal with precision of `5` and scale of `2`:
You can also configure your columns to specify an exact data type for a column. For example, the following code configures `Url` as a non-unicode string with maximum length of `200` and `Rating` as decimal with precision of `5` and scale of `2`:

### [Data Annotations](#tab/data-annotations)

Expand Down