chore:目录重构

This commit is contained in:
陈淳
2023-04-15 17:35:22 +08:00
parent a612af4f68
commit fb27fb8aa4
238 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
using System.Diagnostics.CodeAnalysis;
namespace Yi.Framework.Infrastructure.Utils
{
public class DisposeAction<T> : IDisposable
{
private readonly Action<T> _action;
private readonly T _parameter;
/// <summary>
/// Creates a new <see cref="DisposeAction"/> object.
/// </summary>
/// <param name="action">Action to be executed when this object is disposed.</param>
/// <param name="parameter">The parameter of the action.</param>
public DisposeAction(Action<T> action, T parameter)
{
_action = action;
_parameter = parameter;
}
public void Dispose()
{
_action(_parameter);
}
}
}