Skip to content

Instantly share code, notes, and snippets.

@controlflow
Last active January 3, 2016 09:19
Show Gist options
  • Save controlflow/8441539 to your computer and use it in GitHub Desktop.
Save controlflow/8441539 to your computer and use it in GitHub Desktop.
class Foo {
readonly List<string> _names = new List<string>();
readonly SomeType _someType = new SomeType();
public Foo(string name) {
_names.Add(name);
_someType.SomeProperty = name;
}
}
// =>
class Foo(string name) {
readonly List<string> _names = new List<string> { name };
readonly SomeType _someType = new SomeType { SomeProperty = name };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment