Razzo78
3/11/2019 - 11:26 PM

C# - Create read only list property

C# - Create read only list property for collection encapsulation

private readonly IList<string> _listOfNames = new List<string>();
public virtual IReadOnlyList<string> ListOfNames => _listOfNames.ToList();