using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Properties
{
    public class HasPrivateProperty
    {
        public HasPrivateProperty(int xValue)
        {
            // Can set property here.
            X = xValue;
        }

        // Example 3-36
        public int X { get; private set; } 
    }

    class Example36
    {
        public static void PrivateProperty()
        {
            var o = new HasPrivateProperty(42);
            Console.WriteLine(o.X);

            // This would be illegal:
            //o.X = 99;
        }
    }
}
