C#自动实现的属性

using System;
using System.Collections.Generic;
using System.Text;

namespace 自动属性
{
    class Program
    {
        static void Main(string[] args)
        {
            
        }
    }
    class Person
    {
        //定义可读写属性
        public string Name { get; set; }
        //定义可写属性
        public int Age { get; private set; }
    }
}
原文地址:https://www.cnblogs.com/xiefengdaxia123/p/5983003.html