mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Add interface for database context factory
This commit is contained in:
@ -3,19 +3,17 @@
|
||||
|
||||
namespace osu.Game.Database
|
||||
{
|
||||
public class SingletonContextFactory : DatabaseContextFactory
|
||||
public class SingletonContextFactory : IDatabaseContextFactory
|
||||
{
|
||||
private readonly OsuDbContext context;
|
||||
|
||||
public SingletonContextFactory(OsuDbContext context)
|
||||
: base(null)
|
||||
{
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
protected override OsuDbContext CreateContext()
|
||||
{
|
||||
return context;
|
||||
}
|
||||
public OsuDbContext Get() => context;
|
||||
|
||||
public DatabaseWriteUsage GetForWrite() => new DatabaseWriteUsage(context, null);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user