.net - C# Automatic Properties -- setting defaults -


what's easiest/straight-forward way of setting default value c# public property?

// how set default this?

public string myproperty { get; set; } 

please don't suggest use private property & implement get/set public properties. trying keep concise, , don't want argument why that's better. thanks.

set default in constructor:

this.myproperty = <defaultvalue>; 

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -