CSharp examples for Custom Type:read only
Declaration Read only property with initialization
using System.Collections.Generic; using System;//from www . j a va2s. com using System.ComponentModel; public class Person { public List<Person> Friends { get; } = new List<Person>(); } class MainClass { static void Main() { Person p = new Person(); Console.WriteLine(p.Friends.Capacity); } }