React to EntityOptions -> DbContextOptions rename
This commit is contained in:
parent
ef4ab17700
commit
ccdedc704d
|
|
@ -187,7 +187,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
services =>
|
services =>
|
||||||
{
|
{
|
||||||
services.AddEntityFramework().AddSqlServer();
|
services.AddEntityFramework().AddSqlServer();
|
||||||
var optionsBuilder = new EntityOptionsBuilder();
|
var optionsBuilder = new DbContextOptionsBuilder();
|
||||||
if (!PlatformHelper.IsMono)
|
if (!PlatformHelper.IsMono)
|
||||||
{
|
{
|
||||||
optionsBuilder.UseSqlServer(database.ConnectionString);
|
optionsBuilder.UseSqlServer(database.ConnectionString);
|
||||||
|
|
@ -196,7 +196,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
{
|
{
|
||||||
optionsBuilder.UseInMemoryStore();
|
optionsBuilder.UseInMemoryStore();
|
||||||
}
|
}
|
||||||
services.AddInstance<EntityOptions>(optionsBuilder.Options);
|
services.AddInstance<DbContextOptions>(optionsBuilder.Options);
|
||||||
});
|
});
|
||||||
|
|
||||||
var ex = await Assert.ThrowsAsync<SqlException>(async () =>
|
var ex = await Assert.ThrowsAsync<SqlException>(async () =>
|
||||||
|
|
@ -214,7 +214,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
|
|
||||||
public virtual Task Invoke(HttpContext context)
|
public virtual Task Invoke(HttpContext context)
|
||||||
{
|
{
|
||||||
var options = context.ApplicationServices.GetService<EntityOptions>();
|
var options = context.ApplicationServices.GetService<DbContextOptions>();
|
||||||
using (var db = new BloggingContext(context.ApplicationServices, options))
|
using (var db = new BloggingContext(context.ApplicationServices, options))
|
||||||
{
|
{
|
||||||
db.Blogs.Add(new Blog());
|
db.Blogs.Add(new Blog());
|
||||||
|
|
@ -315,7 +315,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
|
|
||||||
services.AddScoped<TContext>();
|
services.AddScoped<TContext>();
|
||||||
|
|
||||||
var optionsBuilder = new EntityOptionsBuilder();
|
var optionsBuilder = new DbContextOptionsBuilder();
|
||||||
if (!PlatformHelper.IsMono)
|
if (!PlatformHelper.IsMono)
|
||||||
{
|
{
|
||||||
optionsBuilder.UseSqlServer(database.ConnectionString);
|
optionsBuilder.UseSqlServer(database.ConnectionString);
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
{
|
{
|
||||||
if (!PlatformHelper.IsMono)
|
if (!PlatformHelper.IsMono)
|
||||||
{
|
{
|
||||||
var optionsBuilder = new EntityOptionsBuilder();
|
var optionsBuilder = new DbContextOptionsBuilder();
|
||||||
optionsBuilder.UseSqlServer(_connectionString);
|
optionsBuilder.UseSqlServer(_connectionString);
|
||||||
|
|
||||||
using (var db = new DbContext(optionsBuilder.Options))
|
using (var db = new DbContext(optionsBuilder.Options))
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,11 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
.Single()
|
.Single()
|
||||||
.InformationalVersion;
|
.InformationalVersion;
|
||||||
|
|
||||||
protected BloggingContext(EntityOptions options)
|
protected BloggingContext(DbContextOptions options)
|
||||||
: base(options)
|
: base(options)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
public BloggingContext(IServiceProvider provider, EntityOptions options)
|
public BloggingContext(IServiceProvider provider, DbContextOptions options)
|
||||||
: base(provider, options)
|
: base(provider, options)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,16 +12,16 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
{
|
{
|
||||||
public class BloggingContextWithMigrations : BloggingContext
|
public class BloggingContextWithMigrations : BloggingContext
|
||||||
{
|
{
|
||||||
protected BloggingContextWithMigrations(EntityOptions options)
|
protected BloggingContextWithMigrations(DbContextOptions options)
|
||||||
: base(options)
|
: base(options)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
public BloggingContextWithMigrations(IServiceProvider provider, EntityOptions options)
|
public BloggingContextWithMigrations(IServiceProvider provider, DbContextOptions options)
|
||||||
: base(provider, options)
|
: base(provider, options)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
// Providing a factory method so that the ctor is hidden from DI
|
// Providing a factory method so that the ctor is hidden from DI
|
||||||
public static BloggingContextWithMigrations CreateWithoutExternalServiceProvider(EntityOptions options)
|
public static BloggingContextWithMigrations CreateWithoutExternalServiceProvider(DbContextOptions options)
|
||||||
{
|
{
|
||||||
return new BloggingContextWithMigrations(options);
|
return new BloggingContextWithMigrations(options);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
{
|
{
|
||||||
public class BloggingContextWithPendingModelChanges : BloggingContext
|
public class BloggingContextWithPendingModelChanges : BloggingContext
|
||||||
{
|
{
|
||||||
public BloggingContextWithPendingModelChanges(IServiceProvider provider, EntityOptions options)
|
public BloggingContextWithPendingModelChanges(IServiceProvider provider, DbContextOptions options)
|
||||||
: base(provider, options)
|
: base(provider, options)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
|
||||||
{
|
{
|
||||||
public class BloggingContextWithSnapshotThatThrows : BloggingContext
|
public class BloggingContextWithSnapshotThatThrows : BloggingContext
|
||||||
{
|
{
|
||||||
public BloggingContextWithSnapshotThatThrows(IServiceProvider provider, EntityOptions options)
|
public BloggingContextWithSnapshotThatThrows(IServiceProvider provider, DbContextOptions options)
|
||||||
: base(provider, options)
|
: base(provider, options)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ namespace Microsoft.Data.Entity.Tests
|
||||||
return entityServicesBuilder.AddInMemoryStore();
|
return entityServicesBuilder.AddInMemoryStore();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EntityOptions UseProviderOptions(this EntityOptions options)
|
public static DbContextOptions UseProviderOptions(this DbContextOptions options)
|
||||||
{
|
{
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue