Mega Code Archive

 
Categories / C# Tutorial / Class
 

Combine readonly and read only property

using System; public sealed class Value {     public int intValue = 10; } public sealed class MyController {     public MyController( Value pimpl ) {         this.pimpl = pimpl;     }     public int IntValue {         get {             return pimpl.intValue;         }     }     private readonly Value pimpl; } public sealed class MainClass {     static void Main() {         Value someNumber = new Value( );     } }