C#结构函数与base关键字

 //声明父类
    class ProductsFather
    {
        public double Price
        {
            get;
            set;
        }
        public int Count
        {
            get;
            set;
        }
        public string Id
        { get; 
            set; }

        //给字段赋值 c#结构函数
        public ProductsFather(double price, int count, string id)
        {
            this.Price = price;
            this.Count = count;
            this.Id = id;
        }


    }
  class Xiangjiao:ProductsFather
    {
        public Xiangjiao(double pirce, int count, string id)
            : base(pirce, count, id)
        { 

        }
    }
原文地址:https://www.cnblogs.com/zywf/p/4523425.html