优化了中断功能,增加了节点变量的查看。

This commit is contained in:
fengjiayi
2024-09-22 14:10:13 +08:00
parent 3537a49784
commit c930c870a6
26 changed files with 1686 additions and 494 deletions

View File

@@ -366,6 +366,27 @@ namespace Serein.Library.Utils
#endregion
#region run()
public ISereinIOC Run<T>(string name, Action<T> action)
{
var obj = Get(name);
if (obj != null)
{
if(obj is T service)
{
try
{
action(service);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
return this;
}
public ISereinIOC Run<T>(Action<T> action)
{
var service = GetOrRegisterInstantiate<T>();