I want to use clean and less coded class with automatic properties. All of properties are public. Inside a methods in same class I also used that properties. So, I think that this approach is mashable because I use public properties for internally usage and for a public usage. What is best approach with situation like this one? Use private members inside methods and create properties for public usage or use public (or in some special situation private) properties inside class?
public class Account
{
public int Count {get; set;}
private int Calculate()
{
return Count * Count;
}
}
or use something like this
public class Account
{
private int _count;
public int Count {
get
{
return _count;
}
set
{
_count = value,
}
}
private int Calculate()
{
return _count * _count;
}
}