React to DbContextOptions name change
This commit is contained in:
parent
c6c5c94971
commit
760be0c77c
|
|
@ -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<DbContextOptions>(optionsBuilder.Options);
|
||||
services.AddInstance<EntityOptions>(optionsBuilder.Options);
|
||||
});
|
||||
|
||||
var ex = await Assert.ThrowsAsync<SqlException>(async () =>
|
||||
|
|
@ -214,7 +214,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
|||
|
||||
public virtual Task Invoke(HttpContext context)
|
||||
{
|
||||
var options = context.ApplicationServices.GetService<DbContextOptions>();
|
||||
var options = context.ApplicationServices.GetService<EntityOptions>();
|
||||
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<TContext>();
|
||||
|
||||
var optionsBuilder = new DbContextOptionsBuilder();
|
||||
var optionsBuilder = new EntityOptionsBuilder();
|
||||
if (!PlatformHelper.IsMono)
|
||||
{
|
||||
optionsBuilder.UseSqlServer(database.ConnectionString);
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{ }
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{ }
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{ }
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue