Skip to content

Instantly share code, notes, and snippets.

@khellang
Last active August 29, 2015 14:07
Show Gist options
  • Save khellang/8d3ebad9e68e68821a5a to your computer and use it in GitHub Desktop.
Save khellang/8d3ebad9e68e68821a5a to your computer and use it in GitHub Desktop.
public class Movie
{
public string Title { get; } = "The Big Lebowski";
public List<string> Genres { get; } = new List<string> { "Comedy", "Crime" };
}
public class Movie
{
[CompilerGenerated]
private readonly string <Title>k__BackingField;
[CompilerGenerated]
private readonly List<string> <Genres>k__BackingField;
public string Title
{
[CompilerGenerated]
get { return this.<Title>k__BackingField; }
}
public List<string> Genres
{
[CompilerGenerated]
get { return this.<Genres>k__BackingField; }
}
public Movie()
{
this.<Title>k__BackingField = "The Big Lebowski";
this.<Genres>k__BackingField = new List<string> { "Comedy", "Crime" };
base(); // This is not valid C#, but it represents the IL correctly.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment