static void Main(string[] args) { MyObject a1 = null, a2 = null; MyObject.Create(i => a1 = i); MyObject.Create(i => a2 = i); Console.WriteLine("a1 hashcode:" + a1.GetHashCode()); // 46104728 Console.WriteLine("a2 hashcode:" + a2.GetHashCode()); // 12289376 a1.SwapWith(a2); Console.WriteLine("a1 hashcode:" + a1.GetHashCode()); // 12289376 Console.WriteLine("a2 hashcode:" + a2.GetHashCode()); // 46104728 }
public async Task Handle(CreateMyObjectCommand message, IMessageHandlerContext context) { await MyObject.Create(message.Name); await _service.DoSomethingElse(); }