Possible Duplicate:
How do you give a C# Auto-Property a default value?
Hi all:
If I want to add default value, says 60, to following property for a class, what is the most convenient way in C#3.0
public int someSetting { get; set; }
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I would think the best way is to set the default in the constructor of the class