mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-20 08:16:34 +08:00
优化了中断功能,增加了节点变量的查看。
This commit is contained in:
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user