This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Download Microsoft Edge
More info about Internet Explorer and Microsoft Edge
Configures the context to connect to the legacy shared in-memory database.
This method is obsolete. Use
UseInMemoryDatabase(DbContextOptionsBuilder, String, Action<InMemoryDbContextOptionsBuilder>)
instead.
UseInMemoryDatabase(DbContextOptionsBuilder, String, Action<InMemoryDbContextOptionsBuilder>)
Configures the context to connect to a named in-memory database.
The in-memory database is shared anywhere the same name is used, but only for a given
service provider. To use the same in-memory database across service providers, call
UseInMemoryDatabase(DbContextOptionsBuilder, String, InMemoryDatabaseRoot, Action<InMemoryDbContextOptionsBuilder>)
passing a shared
InMemoryDatabaseRoot
on which to root the database.
UseInMemoryDatabase(DbContextOptionsBuilder, String, InMemoryDatabaseRoot, Action<InMemoryDbContextOptionsBuilder>)
Configures the context to connect to a named in-memory database.
The in-memory database is shared anywhere the same name is used, but only for a given
service provider.
Configures the context to connect to the legacy shared in-memory database.
This method is obsolete. Use
UseInMemoryDatabase<TContext>(DbContextOptionsBuilder<TContext>, String, Action<InMemoryDbContextOptionsBuilder>)
instead.
UseInMemoryDatabase<TContext>(DbContextOptionsBuilder<TContext>, String, Action<InMemoryDbContextOptionsBuilder>)
Configures the context to connect to an in-memory database.
The in-memory database is shared anywhere the same name is used, but only for a given
service provider. To use the same in-memory database across service providers, call
UseInMemoryDatabase<TContext>(DbContextOptionsBuilder<TContext>, String, InMemoryDatabaseRoot, Action<InMemoryDbContextOptionsBuilder>)
passing a shared
InMemoryDatabaseRoot
on which to root the database.
UseInMemoryDatabase<TContext>(DbContextOptionsBuilder<TContext>, String, InMemoryDatabaseRoot, Action<InMemoryDbContextOptionsBuilder>)
Configures the context to connect to an in-memory database.
The in-memory database is shared anywhere the same name is used, but only for a given
service provider.
Configures the context to connect to the legacy shared in-memory database.
This method is obsolete. Use
UseInMemoryDatabase(DbContextOptionsBuilder, String, Action<InMemoryDbContextOptionsBuilder>)
instead.
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder UseInMemoryDatabase (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder optionsBuilder, Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder> inMemoryOptionsAction = default);
[System.Obsolete("Use UseInMemoryDatabase(string) instead. The database will be shared anywhere the same name is used.")]
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder UseInMemoryDatabase (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder optionsBuilder, Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder> inMemoryOptionsAction = default);
[System.Obsolete("Use UseInMemoryDatabase(string, InMemoryDatabaseRoot) instead.")]
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder UseInMemoryDatabase (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder optionsBuilder, Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder> inMemoryOptionsAction = default);
static member UseInMemoryDatabase : Microsoft.EntityFrameworkCore.DbContextOptionsBuilder * Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder> -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder
[<System.Obsolete("Use UseInMemoryDatabase(string) instead. The database will be shared anywhere the same name is used.")>]
static member UseInMemoryDatabase : Microsoft.EntityFrameworkCore.DbContextOptionsBuilder * Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder> -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder
[<System.Obsolete("Use UseInMemoryDatabase(string, InMemoryDatabaseRoot) instead.")>]
static member UseInMemoryDatabase : Microsoft.EntityFrameworkCore.DbContextOptionsBuilder * Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder> -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder
<Extension()>
Public Function UseInMemoryDatabase (optionsBuilder As DbContextOptionsBuilder, Optional inMemoryOptionsAction As Action(Of InMemoryDbContextOptionsBuilder) = Nothing) As DbContextOptionsBuilder
Parameters
Configures the context to connect to a named in-memory database.
The in-memory database is shared anywhere the same name is used, but only for a given
service provider. To use the same in-memory database across service providers, call
UseInMemoryDatabase(DbContextOptionsBuilder, String, InMemoryDatabaseRoot, Action<InMemoryDbContextOptionsBuilder>)
passing a shared
InMemoryDatabaseRoot
on which to root the database.
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder UseInMemoryDatabase (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder optionsBuilder, string databaseName, Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder> inMemoryOptionsAction = default);
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder UseInMemoryDatabase (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder optionsBuilder, string databaseName, Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder>? inMemoryOptionsAction = default);
static member UseInMemoryDatabase : Microsoft.EntityFrameworkCore.DbContextOptionsBuilder * string * Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder> -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder
<Extension()>
Public Function UseInMemoryDatabase (optionsBuilder As DbContextOptionsBuilder, databaseName As String, Optional inMemoryOptionsAction As Action(Of InMemoryDbContextOptionsBuilder) = Nothing) As DbContextOptionsBuilder
Parameters
The name of the in-memory database. This allows the scope of the in-memory database to be controlled
independently of the context. The in-memory database is shared anywhere the same name is used.
Configures the context to connect to a named in-memory database.
The in-memory database is shared anywhere the same name is used, but only for a given
service provider.
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder UseInMemoryDatabase (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder optionsBuilder, string databaseName, Microsoft.EntityFrameworkCore.Storage.InMemoryDatabaseRoot databaseRoot, Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder> inMemoryOptionsAction = default);
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder UseInMemoryDatabase (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder optionsBuilder, string databaseName, Microsoft.EntityFrameworkCore.Storage.InMemoryDatabaseRoot? databaseRoot, Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder>? inMemoryOptionsAction = default);
static member UseInMemoryDatabase : Microsoft.EntityFrameworkCore.DbContextOptionsBuilder * string * Microsoft.EntityFrameworkCore.Storage.InMemoryDatabaseRoot * Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder> -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder
<Extension()>
Public Function UseInMemoryDatabase (optionsBuilder As DbContextOptionsBuilder, databaseName As String, databaseRoot As InMemoryDatabaseRoot, Optional inMemoryOptionsAction As Action(Of InMemoryDbContextOptionsBuilder) = Nothing) As DbContextOptionsBuilder
Parameters
The name of the in-memory database. This allows the scope of the in-memory database to be controlled
independently of the context. The in-memory database is shared anywhere the same name is used.
All in-memory databases will be rooted in this object, allowing the application
to control their lifetime. This is useful when sometimes the context instance
is created explicitly with
new
while at other times it is resolved using dependency injection.
Configures the context to connect to the legacy shared in-memory database.
This method is obsolete. Use
UseInMemoryDatabase<TContext>(DbContextOptionsBuilder<TContext>, String, Action<InMemoryDbContextOptionsBuilder>)
instead.
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> UseInMemoryDatabase<TContext> (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> optionsBuilder, Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder> inMemoryOptionsAction = default) where TContext : Microsoft.EntityFrameworkCore.DbContext;
[System.Obsolete("Use UseInMemoryDatabase(string) instead. The database will be shared anywhere the same name is used.")]
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> UseInMemoryDatabase<TContext> (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> optionsBuilder, Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder> inMemoryOptionsAction = default) where TContext : Microsoft.EntityFrameworkCore.DbContext;
[System.Obsolete("Use UseInMemoryDatabase(string, InMemoryDatabaseRoot) instead.")]
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> UseInMemoryDatabase<TContext> (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> optionsBuilder, Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder> inMemoryOptionsAction = default) where TContext : Microsoft.EntityFrameworkCore.DbContext;
static member UseInMemoryDatabase : Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<'Context (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)> * Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder> -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<'Context (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)> (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)
[<System.Obsolete("Use UseInMemoryDatabase(string) instead. The database will be shared anywhere the same name is used.")>]
static member UseInMemoryDatabase : Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<'Context (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)> * Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder> -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<'Context (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)> (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)
[<System.Obsolete("Use UseInMemoryDatabase(string, InMemoryDatabaseRoot) instead.")>]
static member UseInMemoryDatabase : Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<'Context (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)> * Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder> -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<'Context (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)> (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)
<Extension()>
Public Function UseInMemoryDatabase(Of TContext As DbContext) (optionsBuilder As DbContextOptionsBuilder(Of TContext), Optional inMemoryOptionsAction As Action(Of InMemoryDbContextOptionsBuilder) = Nothing) As DbContextOptionsBuilder(Of TContext)
Type Parameters
TContext
Configures the context to connect to an in-memory database.
The in-memory database is shared anywhere the same name is used, but only for a given
service provider. To use the same in-memory database across service providers, call
UseInMemoryDatabase<TContext>(DbContextOptionsBuilder<TContext>, String, InMemoryDatabaseRoot, Action<InMemoryDbContextOptionsBuilder>)
passing a shared
InMemoryDatabaseRoot
on which to root the database.
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> UseInMemoryDatabase<TContext> (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> optionsBuilder, string databaseName, Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder> inMemoryOptionsAction = default) where TContext : Microsoft.EntityFrameworkCore.DbContext;
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> UseInMemoryDatabase<TContext> (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> optionsBuilder, string databaseName, Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder>? inMemoryOptionsAction = default) where TContext : Microsoft.EntityFrameworkCore.DbContext;
static member UseInMemoryDatabase : Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<'Context (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)> * string * Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder> -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<'Context (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)> (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)
<Extension()>
Public Function UseInMemoryDatabase(Of TContext As DbContext) (optionsBuilder As DbContextOptionsBuilder(Of TContext), databaseName As String, Optional inMemoryOptionsAction As Action(Of InMemoryDbContextOptionsBuilder) = Nothing) As DbContextOptionsBuilder(Of TContext)
Type Parameters
TContext
The name of the in-memory database. This allows the scope of the in-memory database to be controlled
independently of the context. The in-memory database is shared anywhere the same name is used.
Configures the context to connect to an in-memory database.
The in-memory database is shared anywhere the same name is used, but only for a given
service provider.
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> UseInMemoryDatabase<TContext> (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> optionsBuilder, string databaseName, Microsoft.EntityFrameworkCore.Storage.InMemoryDatabaseRoot databaseRoot, Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder> inMemoryOptionsAction = default) where TContext : Microsoft.EntityFrameworkCore.DbContext;
public static Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> UseInMemoryDatabase<TContext> (this Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<TContext> optionsBuilder, string databaseName, Microsoft.EntityFrameworkCore.Storage.InMemoryDatabaseRoot? databaseRoot, Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder>? inMemoryOptionsAction = default) where TContext : Microsoft.EntityFrameworkCore.DbContext;
static member UseInMemoryDatabase : Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<'Context (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)> * string * Microsoft.EntityFrameworkCore.Storage.InMemoryDatabaseRoot * Action<Microsoft.EntityFrameworkCore.Infrastructure.InMemoryDbContextOptionsBuilder> -> Microsoft.EntityFrameworkCore.DbContextOptionsBuilder<'Context (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)> (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)
<Extension()>
Public Function UseInMemoryDatabase(Of TContext As DbContext) (optionsBuilder As DbContextOptionsBuilder(Of TContext), databaseName As String, databaseRoot As InMemoryDatabaseRoot, Optional inMemoryOptionsAction As Action(Of InMemoryDbContextOptionsBuilder) = Nothing) As DbContextOptionsBuilder(Of TContext)
Type Parameters
TContext
The name of the in-memory database. This allows the scope of the in-memory database to be controlled
independently of the context. The in-memory database is shared anywhere the same name is used.
All in-memory databases will be rooted in this object, allowing the application
to control their lifetime. This is useful when sometimes the context instance
is created explicitly with
new
while at other times it is resolved using dependency injection.