// Listing 16-21
using System;
using System.Collections.Generic;
using System.Linq;

[Serializable]
class Person
{
    private readonly List<Person> _friends = new List<Person>();

    public string Name { get; set; }

    public IList<Person> Friends { get { return _friends; } }

    public override string ToString()
    {
        return string.Format("{0} (przyjaciele: {1})",
            Name, string.Join(", ", Friends.Select(f => f.Name)));
    }
}
