public object CopyToEndContainer(EmberWriter writer, EmberId? outerId)
{
if (writer == null)
{
throw new ArgumentNullException(nameof(writer));
}
object result = null;
var inner = -1;
while (this.Read() && ((inner = this.innerNumber.GetValueOrDefault()) != Ember.InnerNumber.EndContainer))
{
var candidate = this.CopyCore(writer, inner);
if (this.outer.HasValue && (this.outer.Value == outerId))
{
result = candidate;
}
}
if (inner == Ember.InnerNumber.EndContainer)
{
writer.WriteEndContainer();
}
return result;
}