private static async void SendCommand(IBusControl bus, Uri sendToUri) { var endPoint = await bus.GetSendEndpoint(sendToUri); var command = new Demo001.ABC() { Name = "张三", Time = DateTime.Now }; await endPoint.Send(command); Console.WriteLine($"send command:id={command.Name},{command.Time}"); }
private static async void SendCommand(IBusControl bus, Uri sendToUri, string mes) { var endPoint = await bus.GetSendEndpoint(sendToUri); var command = new Demo001.ABC() { Name = "张三", Birthday = DateTime.Now, Message = mes }; await endPoint.Send(command); Console.WriteLine($"发送的实体 Name={command.Name},Birthday={command.Birthday},Message={command.Message}"); }