public void Write(IFormatWriter writer, object instance) { var list = instance as IList; if (list != null) { var references = _references.Get(writer); var hold = _reserved.Get(writer); foreach (var item in list) { if (references.Contains(item)) { hold.Get(item).Push(list); } } } _serializer.Write(writer, instance); }
protected override IEncounters Create(IFormatWriter parameter) => new Encounters(_references.Get(parameter) .ToDictionary(x => x, Get));