private static IEnumerable <CollectionOperation <T> > Enumerate([NotNull] ICollectionReplaceOperation <T> replace) { yield return(CollectionOperation <T> .OnRemove(replace.ReplacedItem)); yield return(CollectionOperation <T> .OnAdd(replace.Item)); }
private static ItemOrEnumerable <CollectionOperation <T> > OnReplace([NotNull] ICollectionReplaceOperation <T> replace) => new ItemOrEnumerable <CollectionOperation <T> >(Enumerate(replace));