public ServiceContainer(IServiceCollection serviceDescriptors, ContainerOptions options = null) : base(ApplyOptions(options)) { this.varianceFilter = varianceFilterConfig; this.serviceDescriptors = serviceDescriptors ?? throw new ArgumentNullException(nameof(serviceDescriptors)); this.PropertyDependencySelector = new PropertyDependencySelector(this.PropertyDependencySelector); this.RegisterInstance <IServiceCollection>(this); }
private static ContainerOptions ApplyOptions(ContainerOptions options) { if (options == null) { options = new ContainerOptions(); } varianceFilterConfig = new VarianceFilter(options.VarianceFilter); options.VarianceFilter = varianceFilterConfig.Filter; return(options); }
/// <summary> /// Returns a hash code for this instance. /// </summary> /// <returns> /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. /// </returns> public override int GetHashCode() { var hash = 17; hash = 23 * hash + AmplitudeThreshold.GetHashCode(); hash = 23 * hash + VarianceThreshold.GetHashCode(); hash = 23 * hash + QualityIndex.GetHashCode(); hash = 23 * hash + AmplitudeFilter.GetHashCode(); hash = 23 * hash + VarianceFilter.GetHashCode(); hash = 23 * hash + Centroids.GetHashCode(); hash = 23 * hash + Partition.GetHashCode(); hash = 23 * hash + Merged.GetHashCode(); hash = 23 * hash + Subregions.GetHashCode(); return(hash); }