public SnapsChannel([NotNull] SnapsChannel snapChannel) { if (snapChannel == null) { throw new ArgumentNullException(nameof(snapChannel)); } Name = snapChannel.Name; PushFeed = snapChannel.PushFeed; UpdateFeed = snapChannel.UpdateFeed; }
internal SnapsChannel([NotNull] SnapChannel snapChannel) { if (snapChannel == null) { throw new ArgumentNullException(nameof(snapChannel)); } Name = snapChannel.Name; PushFeed = new SnapsNugetFeed(snapChannel.PushFeed); UpdateFeed = snapChannel.UpdateFeed switch { SnapNugetFeed snapNugetFeed => new SnapsNugetFeed(snapNugetFeed), SnapHttpFeed snapHttpFeed => new SnapsHttpFeed(snapHttpFeed), _ => throw new NotSupportedException($"Unknown update feed type: {snapChannel.UpdateFeed?.GetType()}.") }; }
internal SnapsChannel([JetBrains.Annotations.NotNull] SnapChannel snapChannel) { if (snapChannel == null) { throw new ArgumentNullException(nameof(snapChannel)); } Name = snapChannel.Name; PushFeed = new SnapsNugetFeed(snapChannel.PushFeed); switch (snapChannel.UpdateFeed) { case SnapNugetFeed snapNugetFeed: UpdateFeed = new SnapsNugetFeed(snapNugetFeed); break; case SnapHttpFeed snapHttpFeed: UpdateFeed = new SnapsHttpFeed(snapHttpFeed); break; default: throw new NotSupportedException($"Unknown update feed type: {snapChannel.UpdateFeed?.GetType()}."); } }