namespace LaaProduction { using System.Collections.Generic; using System.Runtime.InteropServices; [ClassInterface(ClassInterfaceType.AutoDual)] public class EquipmentsResult { private readonly Queue equipments = new Queue(); public Error Error { get; set; } public bool Succeeded => this.Error is null; public int Count => this.equipments.Count; public Equipment Next { get { var next = this.equipments.Dequeue(); this.equipments.Enqueue(next); return next; } } internal void AddRange(IEnumerable equipments) { if (equipments is null) { return; } foreach (var e in equipments) { this.equipments.Enqueue(e); } } } }