private ISsrsObjectSource GetObjectSource() { if (!SourcePaths.Any()) { throw new InvalidArgumentsException("No source paths specified."); } var sourceFactory = new ObjectSourceFactory() { ReportingServiceClientFactory = ReportingServiceClientFactory, BasePath = BasePath }; var aggregateSource = new AggregatedObjectSource(); try { foreach (var path in SourcePaths) { aggregateSource.Add(sourceFactory.Create(path)); } return(aggregateSource); } catch { aggregateSource.Dispose(); throw; } }
public ISsrsObjectSource Create(IEnumerable <string> sourceIdentifiers) { var aggregateSource = new AggregatedObjectSource(); try { foreach (var sourceIdentifier in sourceIdentifiers) { aggregateSource.Add(Create(sourceIdentifier)); } return(aggregateSource); } catch { aggregateSource.Dispose(); throw; } }