Created
November 2, 2018 15:53
-
-
Save jskeet/b34519a73a485dee490397d37b4de3f5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Message | |
{ | |
public string Body { get; set; } | |
public Message GetNewMessage() | |
{ | |
return new Message | |
{ | |
Body = Body | |
}; | |
} | |
} | |
class Test | |
{ | |
static void Main() | |
{ | |
Message m1 = new Message { Body = "test" }; | |
Message m2 = m1.GetNewMessage(); | |
Console.WriteLine(m2.Body); // Prints test | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment