public void AddTo(IList <IConstructionInfo> constructionInfos, ConstructionKey key) { if (ParameterCount > 0) { var dataSources = key.MappingData.MapperData.DataSourcesByTargetMember; var relevantDataSourceSets = ArgumentDataSources .Filter(dataSources, (dss, ds) => !dss.ContainsKey(ds.MapperData.TargetMember)); foreach (var dataSourceSet in relevantDataSourceSets) { dataSources.Add(dataSourceSet.MapperData.TargetMember, dataSourceSet); } } constructionInfos.AddThenSort(this); }
protected ConstructionDataInfo( TInvokable invokable, ConstructionKey key, int priority) { ArgumentDataSources = GetArgumentDataSources(invokable, key); CanBeInvoked = ArgumentDataSources.All(ds => ds.HasValue); ParameterCount = ArgumentDataSources.Length; Priority = priority; if (!CanBeInvoked) { return; } IsUnconditional = !ArgumentDataSources.Any(ds => ds.IsConditional && ds.MapperData.TargetMember.IsComplex); }