-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nate McMaster
committed
Jan 12, 2016
1 parent
62ea44d
commit 099bf7b
Showing
3 changed files
with
218 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Command Line | ||
============ | ||
|
||
Entity Framework provides command line tooling to automate common tasks | ||
such as code generation and database migrations. | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
|
||
powershell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,207 @@ | ||
Package Manager Console (Visual Studio) | ||
======================================= | ||
|
||
Commands for Powershell in Visual Studio's Package Manager Console window. | ||
|
||
.. contents:: `In this article:` | ||
:depth: 2 | ||
:local: | ||
|
||
|
||
Installation | ||
-------------- | ||
|
||
Package Manager Console commands are installed with the *EntityFramework.Commands* package. | ||
|
||
To open the console, follow these steps. | ||
|
||
* Open Visual Studio 2015 | ||
* :menuselection:`Tools --> Nuget Package Manager --> Package Manager Console` | ||
* Execute ``Install-Package EntityFramework.Commands -Pre`` | ||
|
||
Commands | ||
-------- | ||
|
||
.. note:: | ||
|
||
All commands support the common parameters: ``Verbose``, ``Debug``, | ||
``ErrorAction``, ``ErrorVariable``, ``WarningAction``, ``WarningVariable``, | ||
``OutBuffer``, ``PipelineVariable``, and ``OutVariable``. For more information, see | ||
`about_CommonParameters <http://go.microsoft.com/fwlink/?LinkID=113216)>`_. | ||
|
||
|
||
Add-Migration | ||
~~~~~~~~~~~~~~~~~ | ||
Adds a new migration. | ||
|
||
:: | ||
|
||
|
||
SYNTAX | ||
Add-Migration [-Name] <String> [-OutputDir <String>] [-Context <String>] [-Project <String>] [-StartupProject <String>] [-Environment <String>] [<CommonParameters>] | ||
|
||
PARAMETERS | ||
-Name <String> | ||
Specifies the name of the migration. | ||
|
||
-OutputDir <String> | ||
The directory (and sub-namespace) to use. If ``omitted``, "Migrations" is used. | ||
|
||
-Context <String> | ||
Specifies the DbContext to use. If ``omitted``, the default DbContext is used. | ||
|
||
-Project <String> | ||
Specifies the project to use. If omitted, the default project is used. | ||
|
||
-StartupProject <String> | ||
Specifies the startup project to use. If omitted, the solution's startup project is used. | ||
|
||
-Environment <String> | ||
Specifies the environment to use. If omitted, "Development" is used. | ||
|
||
|
||
Remove-Migration | ||
~~~~~~~~~~~~~~~~~ | ||
Removes the last migration. | ||
|
||
:: | ||
|
||
SYNTAX | ||
Remove-Migration [-Context <String>] [-Project <String>] [-StartupProject <String>] [-Environment <String>] [<CommonParameters>] | ||
|
||
PARAMETERS | ||
-Context <String> | ||
Specifies the DbContext to use. If omitted, the default DbContext is used. | ||
|
||
-Project <String> | ||
Specifies the project to use. If omitted, the default project is used. | ||
|
||
-StartupProject <String> | ||
Specifies the startup project to use. If omitted, the solution's startup project is used. | ||
|
||
-Environment <String> | ||
Specifies the environment to use. If omitted, "Development" is used. | ||
|
||
|
||
Scaffold-DbContext | ||
~~~~~~~~~~~~~~~~~~ | ||
Scaffolds a DbContext and entity type classes for a specified database. | ||
|
||
:: | ||
|
||
SYNTAX | ||
Scaffold-DbContext [-Connection] <String> [-Provider] <String> [-OutputDirectory <String>] [-ContextClassName <String>] [-Schemas <String[]>] [-Tables <String[]>] [-DataAnnotations] [-Project | ||
<String>] [-StartupProject <String>] [-Environment <String>] [<CommonParameters>] | ||
|
||
PARAMETERS | ||
-Connection <String> | ||
Specifies the connection string of the database. | ||
|
||
-Provider <String> | ||
Specifies the provider to use. For example, EntityFramework.MicrosoftSqlServer. | ||
|
||
-OutputDirectory <String> | ||
Specifies the directory to use to output the classes. If omitted, the top-level project directory is used. | ||
|
||
-ContextClassName <String> | ||
|
||
-Schemas <String[]> | ||
Specifies the schemas for which to generate classes. | ||
|
||
-Tables <String[]> | ||
Specifies the tables for which to generate classes. | ||
|
||
-DataAnnotations [<SwitchParameter>] | ||
Use DataAnnotation attributes to configure the model where possible. If omitted, the output code will use only the fluent API. | ||
|
||
|
||
-Project <String> | ||
Specifies the project to use. If omitted, the default project is used. | ||
|
||
-StartupProject <String> | ||
Specifies the startup project to use. If omitted, the solution's startup project is used. | ||
|
||
-Environment <String> | ||
Specifies the environment to use. If omitted, "Development" is used. | ||
|
||
Script-Migration | ||
~~~~~~~~~~~~~~~~~ | ||
Generates a SQL script from migrations. | ||
|
||
:: | ||
|
||
SYNTAX | ||
Script-Migration -From <String> -To <String> [-Idempotent] [-Context <String>] [-Project <String>] [-StartupProject <String>] [-Environment <String>] [<CommonParameters>] | ||
|
||
Script-Migration [-From <String>] [-Idempotent] [-Context <String>] [-Project <String>] [-StartupProject <String>] [-Environment <String>] [<CommonParameters>] | ||
PARAMETERS | ||
-From <String> | ||
Specifies the starting migration. If omitted, '0' (the initial database) is used. | ||
|
||
-To <String> | ||
Specifies the ending migration. If omitted, the last migration is used. | ||
|
||
-Idempotent [<SwitchParameter>] | ||
Generates an idempotent script that can used on a database at any migration. | ||
|
||
-Context <String> | ||
Specifies the DbContext to use. If omitted, the default DbContext is used. | ||
|
||
-Project <String> | ||
Specifies the project to use. If omitted, the default project is used. | ||
|
||
-StartupProject <String> | ||
Specifies the startup project to use. If omitted, the solution's startup project is used. | ||
|
||
-Environment <String> | ||
Specifies the environment to use. If omitted, "Development" is used. | ||
|
||
|
||
Update-Database | ||
~~~~~~~~~~~~~~~~~ | ||
Updates the database to a specified migration. | ||
|
||
:: | ||
|
||
SYNTAX | ||
Update-Database [[-Migration] <String>] [-Context <String>] [-Project <String>] [-StartupProject <String>] [-Environment <String>] [<CommonParameters>] | ||
|
||
PARAMETERS | ||
-Migration <String> | ||
Specifies the target migration. If '0', all migrations will be reverted. If omitted, all pending migrations will be applied. | ||
|
||
-Context <String> | ||
Specifies the DbContext to use. If omitted, the default DbContext is used. | ||
|
||
-Project <String> | ||
Specifies the project to use. If omitted, the default project is used. | ||
|
||
-StartupProject <String> | ||
Specifies the startup project to use. If omitted, the solution's startup project is used. | ||
|
||
-Environment <String> | ||
Specifies the environment to use. If omitted, "Development" is used. | ||
|
||
|
||
Use-DbContext | ||
~~~~~~~~~~~~~~~~~ | ||
Sets the default DbContext to use. | ||
|
||
:: | ||
|
||
SYNTAX | ||
Use-DbContext [-Context] <String> [-Project <String>] [-StartupProject <String>] [-Environment <String>] [<CommonParameters>] | ||
|
||
PARAMETERS | ||
-Context <String> | ||
Specifies the DbContext to use. | ||
|
||
-Project <String> | ||
Specifies the project to use. If omitted, the default project is used. | ||
|
||
-StartupProject <String> | ||
Specifies the startup project to use. If omitted, the solution's startup project is used. | ||
|
||
-Environment <String> | ||
Specifies the environment to use. If omitted, "Development" is used. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters