Posts Tagged ‘C# automatic properties refactoring’

Refactoring C# Series: Use Automatic Property

Name Use Automatic Property Summary You have a property in a class which just wraps a field of the same type, and simply returns or sets that field. private string _field1; public string Field1 { get { return _field1; } set { _field1 = value; } } Becomes: public string Field1 { get; set; } [...]

More »