FilteringReflectionCatalog.CloneNonSharedParts C# (CSharp) Method

CloneNonSharedParts() private method

Clones the non-shared to avoid object instance reuse, which happens if you cache the part definition.
private CloneNonSharedParts ( ) : IEnumerable
return IEnumerable
	private IEnumerable<ComposablePartDefinition> CloneNonSharedParts()
	{
		return this.nonSharedParts
			.AsParallel()
			.Where(part => part != null)
			.Select(def => ReflectionModelServices.CreatePartDefinition(
				ReflectionModelServices.GetPartType(def),
				true,
				new Lazy<IEnumerable<ImportDefinition>>(() => def.ImportDefinitions),
				new Lazy<IEnumerable<ExportDefinition>>(() => def.ExportDefinitions),
				new Lazy<IDictionary<string, object>>(() => def.Metadata),
				this));
	}