internal FunctionImportMappingNonComposable( EdmFunction functionImport, EdmFunction targetFunction, List<List<FunctionImportStructuralTypeMapping>> structuralTypeMappingsList, ItemCollection itemCollection) : base(functionImport, targetFunction) { //Contract.Requires(structuralTypeMappingsList != null); //Contract.Requires(itemCollection != null); Debug.Assert(!functionImport.IsComposableAttribute, "!functionImport.IsComposableAttribute"); Debug.Assert(!targetFunction.IsComposableAttribute, "!targetFunction.IsComposableAttribute"); if (structuralTypeMappingsList.Count == 0) { ResultMappings = new OM.ReadOnlyCollection<FunctionImportStructuralTypeMappingKB>( new[] { new FunctionImportStructuralTypeMappingKB(new List<FunctionImportStructuralTypeMapping>(), itemCollection) }); noExplicitResultMappings = true; } else { Debug.Assert(functionImport.ReturnParameters.Count == structuralTypeMappingsList.Count); ResultMappings = new OM.ReadOnlyCollection<FunctionImportStructuralTypeMappingKB>( structuralTypeMappingsList .Select( (structuralTypeMappings) => new FunctionImportStructuralTypeMappingKB( structuralTypeMappings, itemCollection)) .ToArray()); noExplicitResultMappings = false; } }
internal FunctionImportMappingNonComposable( EdmFunction functionImport, EdmFunction targetFunction, List <List <FunctionImportStructuralTypeMapping> > structuralTypeMappingsList, ItemCollection itemCollection) : base(functionImport, targetFunction) { DebugCheck.NotNull(structuralTypeMappingsList); DebugCheck.NotNull(itemCollection); Debug.Assert(!functionImport.IsComposableAttribute, "!functionImport.IsComposableAttribute"); Debug.Assert(!targetFunction.IsComposableAttribute, "!targetFunction.IsComposableAttribute"); if (structuralTypeMappingsList.Count == 0) { ResultMappings = new OM.ReadOnlyCollection <FunctionImportStructuralTypeMappingKB>( new[] { new FunctionImportStructuralTypeMappingKB(new List <FunctionImportStructuralTypeMapping>(), itemCollection) }); noExplicitResultMappings = true; } else { Debug.Assert(functionImport.ReturnParameters.Count == structuralTypeMappingsList.Count); ResultMappings = new OM.ReadOnlyCollection <FunctionImportStructuralTypeMappingKB>( structuralTypeMappingsList .Select( (structuralTypeMappings) => new FunctionImportStructuralTypeMappingKB( structuralTypeMappings, itemCollection)) .ToArray()); noExplicitResultMappings = false; } }