diff --git a/source/includes/code-examples/quick-reference.cs b/source/includes/code-examples/quick-reference.cs index 2dd0ee9..389a61d 100644 --- a/source/includes/code-examples/quick-reference.cs +++ b/source/includes/code-examples/quick-reference.cs @@ -7,7 +7,6 @@ // Replace the placeholder with your connection URI var client = new MongoClient(""); var db = PlanetDbContext.Create(client.GetDatabase("sample_planets")); -db.Database.EnsureCreated(); // end-create-instance void FindOne() diff --git a/source/includes/fundamentals/code-examples/configure/ConfigureEFProvider.cs b/source/includes/fundamentals/code-examples/configure/ConfigureEFProvider.cs index 3a68939..ce136d5 100644 --- a/source/includes/fundamentals/code-examples/configure/ConfigureEFProvider.cs +++ b/source/includes/fundamentals/code-examples/configure/ConfigureEFProvider.cs @@ -10,7 +10,6 @@ new DbContextOptionsBuilder().UseMongoDB(mongoClient, ""); var db = new MyDbContext(dbContextOptions.Options); -db.Database.EnsureCreated(); // Add a new customer and save it to the database db.Customers.Add(new Customer() { name = "John Doe", Order = "1 Green Tea" }); diff --git a/source/includes/fundamentals/code-examples/configure/UseMongoDB.cs b/source/includes/fundamentals/code-examples/configure/UseMongoDB.cs index 06b675b..e898dd3 100644 --- a/source/includes/fundamentals/code-examples/configure/UseMongoDB.cs +++ b/source/includes/fundamentals/code-examples/configure/UseMongoDB.cs @@ -3,5 +3,4 @@ var dbContextOptions = new DbContextOptionsBuilder().UseMongoDB(mongoClient, " m.Title == "Back to the Future"); Console.WriteLine(movie.Plot); diff --git a/source/upgrade.txt b/source/upgrade.txt index 4af2126..6dbb16a 100644 --- a/source/upgrade.txt +++ b/source/upgrade.txt @@ -72,6 +72,14 @@ Version 8.1.0 Breaking Changes creating the collection or database implicitly. + .. note:: + + Calling the ``EnsureCreated()`` or ``EnsureCreatedAsync()`` method throws + an error if your application is running on a + :atlas:`shared cluster `. + Applications running on free and shared clusters should not call these + methods. + If you don't want to ensure :wikipedia:`optimistic concurrency ` with transactions, you can disable automatic transactions by setting ``Database.AutoTransactionBehavior =