From 760be0c77cb2417bfd05a3c7628d7910a5703ae4 Mon Sep 17 00:00:00 2001 From: Arthur Vickers Date: Tue, 26 May 2015 11:34:48 -0700 Subject: [PATCH] React to DbContextOptions name change --- .../DatabaseErrorPageMiddlewareTest.cs | 8 ++++---- .../SqlServerTestStore.cs | 2 +- .../TestModels/BloggingContext.cs | 4 ++-- .../TestModels/BloggingContextWithMigrations.cs | 6 +++--- .../TestModels/BloggingContextWithPendingModelChanges.cs | 2 +- .../TestModels/BloggingContextWithSnapshotThatThrows.cs | 2 +- .../TestHelperExtensions.cs | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/DatabaseErrorPageMiddlewareTest.cs b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/DatabaseErrorPageMiddlewareTest.cs index a0be9eabbe..41ca08af98 100644 --- a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/DatabaseErrorPageMiddlewareTest.cs +++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/DatabaseErrorPageMiddlewareTest.cs @@ -187,7 +187,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests services => { services.AddEntityFramework().AddSqlServer(); - var optionsBuilder = new DbContextOptionsBuilder(); + var optionsBuilder = new EntityOptionsBuilder(); if (!PlatformHelper.IsMono) { optionsBuilder.UseSqlServer(database.ConnectionString); @@ -196,7 +196,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests { optionsBuilder.UseInMemoryStore(); } - services.AddInstance(optionsBuilder.Options); + services.AddInstance(optionsBuilder.Options); }); var ex = await Assert.ThrowsAsync(async () => @@ -214,7 +214,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests public virtual Task Invoke(HttpContext context) { - var options = context.ApplicationServices.GetService(); + var options = context.ApplicationServices.GetService(); using (var db = new BloggingContext(context.ApplicationServices, options)) { db.Blogs.Add(new Blog()); @@ -315,7 +315,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests services.AddScoped(); - var optionsBuilder = new DbContextOptionsBuilder(); + var optionsBuilder = new EntityOptionsBuilder(); if (!PlatformHelper.IsMono) { optionsBuilder.UseSqlServer(database.ConnectionString); diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/SqlServerTestStore.cs b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/SqlServerTestStore.cs index bd3da2e638..7037bdff78 100644 --- a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/SqlServerTestStore.cs +++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/SqlServerTestStore.cs @@ -42,7 +42,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests { if (!PlatformHelper.IsMono) { - var optionsBuilder = new DbContextOptionsBuilder(); + var optionsBuilder = new EntityOptionsBuilder(); optionsBuilder.UseSqlServer(_connectionString); using (var db = new DbContext(optionsBuilder.Options)) diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContext.cs b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContext.cs index 21ed6f87f8..1a2d369dbb 100644 --- a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContext.cs +++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContext.cs @@ -19,11 +19,11 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests .Single() .InformationalVersion; - protected BloggingContext(DbContextOptions options) + protected BloggingContext(EntityOptions options) : base(options) { } - public BloggingContext(IServiceProvider provider, DbContextOptions options) + public BloggingContext(IServiceProvider provider, EntityOptions options) : base(provider, options) { } diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithMigrations.cs b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithMigrations.cs index d343943548..295581de3a 100644 --- a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithMigrations.cs +++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithMigrations.cs @@ -12,16 +12,16 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests { public class BloggingContextWithMigrations : BloggingContext { - protected BloggingContextWithMigrations(DbContextOptions options) + protected BloggingContextWithMigrations(EntityOptions options) : base(options) { } - public BloggingContextWithMigrations(IServiceProvider provider, DbContextOptions options) + public BloggingContextWithMigrations(IServiceProvider provider, EntityOptions options) : base(provider, options) { } // Providing a factory method so that the ctor is hidden from DI - public static BloggingContextWithMigrations CreateWithoutExternalServiceProvider(DbContextOptions options) + public static BloggingContextWithMigrations CreateWithoutExternalServiceProvider(EntityOptions options) { return new BloggingContextWithMigrations(options); } diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithPendingModelChanges.cs b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithPendingModelChanges.cs index 43e189a4ac..c488450f48 100644 --- a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithPendingModelChanges.cs +++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithPendingModelChanges.cs @@ -12,7 +12,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests { public class BloggingContextWithPendingModelChanges : BloggingContext { - public BloggingContextWithPendingModelChanges(IServiceProvider provider, DbContextOptions options) + public BloggingContextWithPendingModelChanges(IServiceProvider provider, EntityOptions options) : base(provider, options) { } diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithSnapshotThatThrows.cs b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithSnapshotThatThrows.cs index 969725115d..2073cc8ea3 100644 --- a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithSnapshotThatThrows.cs +++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithSnapshotThatThrows.cs @@ -13,7 +13,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests { public class BloggingContextWithSnapshotThatThrows : BloggingContext { - public BloggingContextWithSnapshotThatThrows(IServiceProvider provider, DbContextOptions options) + public BloggingContextWithSnapshotThatThrows(IServiceProvider provider, EntityOptions options) : base(provider, options) { } diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.Tests/TestHelperExtensions.cs b/test/Microsoft.AspNet.Diagnostics.Entity.Tests/TestHelperExtensions.cs index 45bb71451d..0d0a1b1333 100644 --- a/test/Microsoft.AspNet.Diagnostics.Entity.Tests/TestHelperExtensions.cs +++ b/test/Microsoft.AspNet.Diagnostics.Entity.Tests/TestHelperExtensions.cs @@ -13,7 +13,7 @@ namespace Microsoft.Data.Entity.Tests return entityServicesBuilder.AddInMemoryStore(); } - public static DbContextOptions UseProviderOptions(this DbContextOptions options) + public static EntityOptions UseProviderOptions(this EntityOptions options) { return options; }