I get some "System.StackOverflowException was unhandled" by running the following C# code, I don't understand why.
Code:class Test { static void Main(string[] args) { Customer cust = new Customer(); cust.ID = 1; cust.Name = "Parrot"; Console.WriteLine("ID: {0}, Name: {1}", cust.ID, cust.Name); } } class Customer { public int ID { get; set; } public string Name { get { return this.Name; } set { this.Name = value.ToUpper(); } } }




Reply With Quote