public LivestreamModel() { if (!Execute.InDesignMode) { throw new InvalidOperationException("Design time only constructor"); } Id = "DesignTimeId"; ChannelIdentifier = new ChannelIdentifier(); UniqueStreamKey = new UniqueStreamKey(); }
/// <summary> A livestream object from an Api/Channel </summary> /// <param name="id">A unique id for this livestream for its <see cref="ApiClient"/></param> /// <param name="channelIdentifier">The <see cref="ApiClient"/> and unique channel identifier for that api client where this stream came from</param> public LivestreamModel(string id, ChannelIdentifier channelIdentifier) { if (String.IsNullOrWhiteSpace(id)) { throw new ArgumentException("Argument is null or whitespace", nameof(id)); } Id = id; ChannelIdentifier = channelIdentifier ?? throw new ArgumentNullException(nameof(channelIdentifier)); UniqueStreamKey = new UniqueStreamKey(ApiClient.ApiName, Id); }
protected bool Equals(UniqueStreamKey other) { return(ApiClientName.IsEqualTo(other.ApiClientName) && StreamId.IsEqualTo(other.StreamId)); }
public override int GetHashCode() { return(UniqueStreamKey?.GetHashCode() ?? 0); }