mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 23:31:13 -05:00
update for database provider specific migrations
fix issues with live radar
This commit is contained in:
@ -2,31 +2,19 @@
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Interfaces;
|
||||
using System;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace ApplicationTests.Mocks
|
||||
{
|
||||
class DatabaseContextFactoryMock : IDatabaseContextFactory
|
||||
{
|
||||
private DatabaseContext ctx;
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
|
||||
public DatabaseContextFactoryMock(IServiceProvider sp)
|
||||
{
|
||||
_serviceProvider = sp;
|
||||
}
|
||||
|
||||
public DatabaseContext CreateContext(bool? enableTracking)
|
||||
{
|
||||
if (ctx == null)
|
||||
{
|
||||
var contextOptions = new DbContextOptionsBuilder<DatabaseContext>()
|
||||
.UseInMemoryDatabase(databaseName: "database")
|
||||
.Options;
|
||||
var contextOptions = new DbContextOptionsBuilder<SqliteDatabaseContext>()
|
||||
.UseInMemoryDatabase(databaseName: "database")
|
||||
.Options;
|
||||
|
||||
ctx = new DatabaseContext(contextOptions);
|
||||
}
|
||||
|
||||
return ctx;
|
||||
return new SqliteDatabaseContext(contextOptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user