mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Allow "refreshing" instances via DatabaseBackedStore
This commit is contained in:
@ -18,6 +18,11 @@ namespace osu.Game.Database
|
||||
|
||||
private readonly ThreadLocal<OsuDbContext> queryContext;
|
||||
|
||||
/// <summary>
|
||||
/// Refresh an instance potentially from a diffrent thread with a local context-tracked instance.
|
||||
/// </summary>
|
||||
protected void Refresh<T>(ref T obj) where T : class, IHasPrimaryKey => obj = GetContext().Find<T>(obj.ID);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve a shared context for performing lookups (or write operations on the update thread, for now).
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user