From f44702af4e25a287e15df878f703c22ce8534eb0 Mon Sep 17 00:00:00 2001 From: Brice Lambson Date: Mon, 15 Nov 2021 10:46:21 -0800 Subject: [PATCH] Fix some docs bugs Fixes #2967, fixes #3086, fixes #3114 --- entity-framework/core/cli/powershell.md | 4 ++-- entity-framework/core/modeling/data-seeding.md | 2 +- samples/core/Schemas/Migrations/CustomOperation.cs | 6 +++--- samples/core/Schemas/Migrations/CustomOperationMultiSql.cs | 2 +- samples/core/Schemas/Migrations/CustomOperationSql.cs | 2 +- samples/core/Spatial/Projections/GeometryExtensions.cs | 2 +- samples/core/Spatial/SqlServer/Models/City.cs | 2 +- samples/core/Spatial/SqlServer/Models/Country.cs | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/entity-framework/core/cli/powershell.md b/entity-framework/core/cli/powershell.md index a6c2c55613..4d0adaf5be 100644 --- a/entity-framework/core/cli/powershell.md +++ b/entity-framework/core/cli/powershell.md @@ -65,9 +65,9 @@ Before using the tools: The commands refer to a *project* and a *startup project*. -* The *project* is also known as the *target project* because it's where the commands add or remove files. By default, the **Default project** selected in **Package Manager Console** is the target project. You can specify a different project as target project by using the `--project` option. +* The *project* is also known as the *target project* because it's where the commands add or remove files. By default, the **Default project** selected in **Package Manager Console** is the target project. You can specify a different project as target project by using the `-Project` parameter. -* The *startup project* is the one that the tools build and run. The tools have to execute application code at design time to get information about the project, such as the database connection string and the configuration of the model. By default, the **Startup Project** in **Solution Explorer** is the startup project. You can specify a different project as startup project by using the `--startup-project` option. +* The *startup project* is the one that the tools build and run. The tools have to execute application code at design time to get information about the project, such as the database connection string and the configuration of the model. By default, the **Startup Project** in **Solution Explorer** is the startup project. You can specify a different project as startup project by using the `-StartupProject` parameter. The startup project and target project are often the same project. A typical scenario where they are separate projects is when: diff --git a/entity-framework/core/modeling/data-seeding.md b/entity-framework/core/modeling/data-seeding.md index 5a8cbb0661..151ed05fe2 100644 --- a/entity-framework/core/modeling/data-seeding.md +++ b/entity-framework/core/modeling/data-seeding.md @@ -43,7 +43,7 @@ See the [full sample project](https://github.com/dotnet/EntityFramework.Docs/tre Once the data has been added to the model, [migrations](xref:core/managing-schemas/migrations/index) should be used to apply the changes. > [!TIP] -> If you need to apply migrations as part of an automated deployment you can [create a SQL script](xref:core/managing-schemas/migrations/index#generate-sql-scripts) that can be previewed before execution. +> If you need to apply migrations as part of an automated deployment you can [create a SQL script](xref:core/managing-schemas/migrations/applying#sql-scripts) that can be previewed before execution. Alternatively, you can use `context.Database.EnsureCreated()` to create a new database containing the seed data, for example for a test database or when using the in-memory provider or any non-relation database. Note that if the database already exists, `EnsureCreated()` will neither update the schema nor seed data in the database. For relational databases you shouldn't call `EnsureCreated()` if you plan to use Migrations. diff --git a/samples/core/Schemas/Migrations/CustomOperation.cs b/samples/core/Schemas/Migrations/CustomOperation.cs index 3c39b0d2d4..295015da44 100644 --- a/samples/core/Schemas/Migrations/CustomOperation.cs +++ b/samples/core/Schemas/Migrations/CustomOperation.cs @@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Migrations.Operations.Builders; #region snippet_CreateUserOperation -internal class CreateUserOperation : MigrationOperation +public class CreateUserOperation : MigrationOperation { public string Name { get; set; } public string Password { get; set; } @@ -15,7 +15,7 @@ internal class CreateUserOperation : MigrationOperation internal static class MigrationBuilderExtensions { #region snippet_MigrationBuilderExtension - private static OperationBuilder CreateUser( + public static OperationBuilder CreateUser( this MigrationBuilder migrationBuilder, string name, string password) @@ -29,7 +29,7 @@ private static OperationBuilder CreateUser( } #region snippet_MigrationsSqlGenerator -internal class MyMigrationsSqlGenerator : SqlServerMigrationsSqlGenerator +public class MyMigrationsSqlGenerator : SqlServerMigrationsSqlGenerator { public MyMigrationsSqlGenerator( MigrationsSqlGeneratorDependencies dependencies, diff --git a/samples/core/Schemas/Migrations/CustomOperationMultiSql.cs b/samples/core/Schemas/Migrations/CustomOperationMultiSql.cs index a1e4efd056..36f15a2b60 100644 --- a/samples/core/Schemas/Migrations/CustomOperationMultiSql.cs +++ b/samples/core/Schemas/Migrations/CustomOperationMultiSql.cs @@ -6,7 +6,7 @@ internal static class MultiSqlMigrationBuilderExtensions { #region snippet_CustomOperationMultiSql - private static OperationBuilder CreateUser( + public static OperationBuilder CreateUser( this MigrationBuilder migrationBuilder, string name, string password) diff --git a/samples/core/Schemas/Migrations/CustomOperationSql.cs b/samples/core/Schemas/Migrations/CustomOperationSql.cs index 9f6b5e9ea6..65400f0709 100644 --- a/samples/core/Schemas/Migrations/CustomOperationSql.cs +++ b/samples/core/Schemas/Migrations/CustomOperationSql.cs @@ -5,7 +5,7 @@ internal static class SqlMigrationBuilderExtensions { #region snippet_CustomOperationSql - private static OperationBuilder CreateUser( + public static OperationBuilder CreateUser( this MigrationBuilder migrationBuilder, string name, string password) diff --git a/samples/core/Spatial/Projections/GeometryExtensions.cs b/samples/core/Spatial/Projections/GeometryExtensions.cs index 5c55b34e8b..7f3c45932a 100644 --- a/samples/core/Spatial/Projections/GeometryExtensions.cs +++ b/samples/core/Spatial/Projections/GeometryExtensions.cs @@ -6,7 +6,7 @@ namespace NetTopologySuite.Geometries { #region snippet_GeometryExtensions - internal static class GeometryExtensions + public static class GeometryExtensions { private static readonly CoordinateSystemServices _coordinateSystemServices = new CoordinateSystemServices( diff --git a/samples/core/Spatial/SqlServer/Models/City.cs b/samples/core/Spatial/SqlServer/Models/City.cs index 873c86b1dc..5e35cb579d 100644 --- a/samples/core/Spatial/SqlServer/Models/City.cs +++ b/samples/core/Spatial/SqlServer/Models/City.cs @@ -5,7 +5,7 @@ namespace SqlServer.Models { #region snippet_City [Table("Cities", Schema = "Application")] - internal class City + public class City { public int CityID { get; set; } diff --git a/samples/core/Spatial/SqlServer/Models/Country.cs b/samples/core/Spatial/SqlServer/Models/Country.cs index f99fe544b8..b5c5b79bda 100644 --- a/samples/core/Spatial/SqlServer/Models/Country.cs +++ b/samples/core/Spatial/SqlServer/Models/Country.cs @@ -5,7 +5,7 @@ namespace SqlServer.Models { #region snippet_Country [Table("Countries", Schema = "Application")] - internal class Country + public class Country { public int CountryID { get; set; }