How to implement a property in an interface

后端 未结 6 1136
醉话见心
醉话见心 2020-12-04 11:43

I have interface IResourcePolicy containing the property Version. I have to implement this property which contain value, the code written in other

6条回答
  •  日久生厌
    2020-12-04 12:28

    You mean like this?

    class MyResourcePolicy : IResourcePolicy {
        private string version;
    
        public string Version {
            get {
                return this.version;
            }
            set {
                this.version = value;
            }
        }
    }
    

提交回复
热议问题