The namespace to use for all generated classes. Paths are relative to the project directory. See Compiled models for more information. Generates a compiled version of the model used by the DbContext. Defaults to the one specified in AddDbContext or OnConfiguring. Lists and gets information about available DbContext types. Show which database would be dropped, but don't drop it. Defaults to the first one in the project. NET runtime so it doesn't need to be installed on the machine. Bundle-MigrationĬreates an executable to update the database.Īlso bundle the. Defaults to generated from the output directory. The namespace to use for the generated classes. Paths are relative to the target project directory. This is a positional parameter and is required. The Context, Project, and StartupProject parameters support tab-expansion. To show help information about a command, use PowerShell's Get-Help command. If this parameter is omitted, the Startup project in Solution properties is used as the target project. If this parameter is omitted, the Default project for Package Manager Console is used as the target project. If there are multiple context classes, this parameter is required. If this parameter is omitted, EF Core finds the context class. Class name only or fully qualified with namespaces. The following table shows parameters that are common to all of the EF Core commands: Parameter Update-Database -Args '-environment Production' This and any additional arguments are passed into Program.CreateHostBuilder. You can specify the environment for ASP.NET Core projects on the command-line. The dummy project you create to use as startup project provides a concrete target platform into which the tools can load the. NET Standard is not sufficient for the EF Core tools to execute application code. NET implementation it's a specification of a set of APIs that. They can't do that if the EF Core model is in a. NET Framework, the EF Core tools borrow the runtime from the project. ![]() When the EF Core model is in a project that targets. Why is a dummy project required? As mentioned earlier, the tools have to execute application code at design time. The project can be a dummy project with no real code - it is only needed to provide a target for the tooling. NET Framework console app project whose only purpose is to act as startup project for the tools. For example, this is true of Xamarin and Universal Windows Platform apps. NET Standard class library might not have a. The Package Manager Console tools work with. It's also possible to put migrations code in a class library separate from the EF Core context. NET Core console app or web app references the class library.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |