protected override Rpc.Serial.IInstruction BuildInstruction(Rpc.Net.Message.DuplexMessage commandMessage) { using (var scope = ObjectHost.Host.BeginLifetimeScope()) { return(scope.Resolve <AddrAssignInstruction>( new NamedParameter("command", this), new NamedParameter("parameter", commandMessage.GetContent <AddrAssign>()))); } }
protected override Rpc.Serial.IInstruction BuildInstruction(Rpc.Net.Message.DuplexMessage commandMessage) { var instrSet = new InstructionSet(this); using (var scope = ObjectHost.Host.BeginLifetimeScope()) { foreach (var addr in commandMessage.GetContent <TimeSync>().DestinationAddrs) { instrSet.AddInstruction(scope.Resolve <TimeSyncInstruction>( new NamedParameter("command", this), new NamedParameter("parameter", addr))); } } return(instrSet); }
protected override Rpc.Serial.IInstruction BuildInstruction(Rpc.Net.Message.DuplexMessage commandMessage) { var instrSet = new InstructionSet(this); var cardAssign = commandMessage.GetContent <CardAssign>(); using (var scope = ObjectHost.Host.BeginLifetimeScope()) { foreach (var card in cardAssign.Units) { instrSet.AddInstruction(scope.Resolve <CardLogoutInstruction>( new NamedParameter("command", this), new NamedParameter("parameter", card))); } } return(instrSet); }
protected override Rpc.Serial.IInstruction BuildInstruction(Rpc.Net.Message.DuplexMessage commandMessage) { var instrSet = new InstructionSet(this); var sizeAlloc = commandMessage.GetContent <SizeAlloc>(); using (var scope = ObjectHost.Host.BeginLifetimeScope()) { instrSet.AddInstruction(scope.Resolve <SizeAllocInstruction>( new NamedParameter("command", this), new NamedParameter("parameter", sizeAlloc))); foreach (var unit in sizeAlloc.GradeUnits) { instrSet.AddInstruction(scope.Resolve <ClassroomProfileSyncInstruction>( new NamedParameter("command", this), new NamedParameter("parameter", unit))); } } return(instrSet); }