internal SnapChannel([NotNull] string channelName, bool current, [NotNull] SnapNugetFeed pushFeed, [NotNull] SnapFeed updateFeed) { Name = channelName ?? throw new ArgumentNullException(nameof(channelName)); PushFeed = pushFeed ?? throw new ArgumentNullException(nameof(pushFeed)); UpdateFeed = updateFeed ?? throw new ArgumentNullException(nameof(updateFeed)); Current = current; }
internal SnapChannel([NotNull] SnapChannel channel) { if (channel == null) { throw new ArgumentNullException(nameof(channel)); } Name = channel.Name; PushFeed = new SnapNugetFeed(channel.PushFeed); Current = channel.Current; UpdateFeed = channel.UpdateFeed switch { SnapNugetFeed snapNugetFeed => new SnapNugetFeed(snapNugetFeed), SnapHttpFeed snapHttpFeed => new SnapHttpFeed(snapHttpFeed), _ => throw new NotSupportedException(channel.UpdateFeed?.GetType().ToString()) }; }
internal SnapChannel([NotNull] SnapChannel channel) { if (channel == null) { throw new ArgumentNullException(nameof(channel)); } Name = channel.Name; PushFeed = new SnapNugetFeed(channel.PushFeed); Current = channel.Current; switch (channel.UpdateFeed) { case SnapNugetFeed snapNugetFeed: UpdateFeed = new SnapNugetFeed(snapNugetFeed); break; case SnapHttpFeed snapHttpFeed: UpdateFeed = new SnapHttpFeed(snapHttpFeed); break; default: throw new NotSupportedException(channel.UpdateFeed?.GetType().ToString()); } }