/// <summary> /// Initializes a new instance of the <see cref="DomainToolsOriginIdentifier"/> class. /// </summary> public DomainToolsOriginIdentifier(IOriginIdentifier originIdentifier) { if (!OriginatesFromExampleDataSource(originIdentifier)) { throw new ArgumentException("The origin provided is not from the domain tools connectors."); } // If either of these fail the structure is different than originally specified in the example. Source = originIdentifier.Key.ElementAt(0); Id = originIdentifier.Key.ElementAt(1); }
/// <summary> /// Initializes a new instance of the <see cref="SubsettingExampleOriginIdentifier"/> class. /// </summary> public SubsettingExampleOriginIdentifier(IOriginIdentifier originIdentifier, ISubsetExampleOriginHelper subsetExampleOriginHelper) { if (!subsetExampleOriginHelper.OriginatesFromExampleDataSource(originIdentifier)) { throw new ArgumentException("The specified origin is not from the subsetting example."); } // If either of these fails, then the structure of the information // is different from how it was originally specified in the example. Source = originIdentifier.Key.ElementAt(0); Id = originIdentifier.Key.ElementAt(1); }
/// <inheritdoc /> public bool OriginatesFromExampleDataSource(IOriginIdentifier originIdentifier) { return originIdentifier.OriginType.Equals(OriginKey); }
/// <summary> /// Returns whether of not the specified <see cref="IOriginIdentifier"/> is from the subsetting example. /// </summary> public static bool OriginatesFromExampleDataSource(IOriginIdentifier originIdentifier) { return(originIdentifier.OriginType.Equals(OriginKey)); }