mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Initial push to use ILive
in import process
This commit is contained in:
34
osu.Game/Database/EntityFrameworkLive.cs
Normal file
34
osu.Game/Database/EntityFrameworkLive.cs
Normal file
@ -0,0 +1,34 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
|
||||
namespace osu.Game.Database
|
||||
{
|
||||
public class EntityFrameworkLive<T> : ILive<T> where T : class
|
||||
{
|
||||
public EntityFrameworkLive(T item)
|
||||
{
|
||||
Value = item;
|
||||
}
|
||||
|
||||
public Guid ID => throw new InvalidOperationException();
|
||||
|
||||
public void PerformRead(Action<T> perform)
|
||||
{
|
||||
perform(Value);
|
||||
}
|
||||
|
||||
public TReturn PerformRead<TReturn>(Func<T, TReturn> perform)
|
||||
{
|
||||
return perform(Value);
|
||||
}
|
||||
|
||||
public void PerformWrite(Action<T> perform)
|
||||
{
|
||||
perform(Value);
|
||||
}
|
||||
|
||||
public T Value { get; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user