mirror of
https://github.com/ppy/osu.git
synced 2024-11-19 01:03:02 +08:00
20 lines
587 B
C#
20 lines
587 B
C#
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
namespace osu.Game.Database
|
|
{
|
|
public class SingletonContextFactory : IDatabaseContextFactory
|
|
{
|
|
private readonly OsuDbContext context;
|
|
|
|
public SingletonContextFactory(OsuDbContext context)
|
|
{
|
|
this.context = context;
|
|
}
|
|
|
|
public OsuDbContext Get() => context;
|
|
|
|
public DatabaseWriteUsage GetForWrite() => new DatabaseWriteUsage(context, null);
|
|
}
|
|
}
|