mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-16 14:36:34 +08:00
IOC容器添加构造函数注入(DLL类中使用AutoRegisterAttribute特性标注的类,会在流程启动时自动注册),提高可读性。
This commit is contained in:
@@ -21,23 +21,18 @@ namespace Net461DllTest.LogicControl
|
||||
GetPparkingSpace,
|
||||
}
|
||||
|
||||
|
||||
[AutoRegister]
|
||||
[DynamicFlow]
|
||||
public class ParkingLogicControl
|
||||
{
|
||||
[AutoInjection]
|
||||
public PrakingDevice PrakingDevice { get; set; }
|
||||
private readonly PrakingDevice PrakingDevice;
|
||||
|
||||
|
||||
[NodeAction(NodeType.Init)]
|
||||
public void Init(IDynamicContext context)
|
||||
public ParkingLogicControl(PrakingDevice PrakingDevice)
|
||||
{
|
||||
|
||||
context.Env.IOC.Register<PrakingDevice>();
|
||||
this.PrakingDevice = PrakingDevice;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[NodeAction(NodeType.Flipflop, "等待车位调取命令",ReturnType=typeof(string))]
|
||||
public async Task<IFlipflopContext> GetPparkingSpace(ParkingCommand parkingCommand = ParkingCommand.GetPparkingSpace)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user