/// <summary> /// This method will go through function-import result-column type mappings. /// For each type-mapping checks whether there exists a type-mapping that involves the passed-in property. /// If a match is found, the corresponding column name is returned. /// If no match could be found, an empty string is returned. /// </summary> /// <param name="property"></param> /// <returns></returns> internal static string GetFunctionImportResultColumnName(FunctionImport functionImport, Property property) { if (functionImport == null) { throw new ArgumentException("functionImport is null."); } if (property == null) { throw new ArgumentException("property is null"); } var mapping = functionImport.FunctionImportMapping; if (mapping != null && mapping.ResultMapping != null) { foreach (var typeMapping in mapping.ResultMapping.TypeMappings()) { var scalarProperty = typeMapping.FindScalarProperty(property); if (scalarProperty != null) { Debug.Assert(!String.IsNullOrEmpty(scalarProperty.ColumnName.Value), "Function Import Result Column name is empty"); if (!String.IsNullOrEmpty(scalarProperty.ColumnName.Value)) { return(scalarProperty.ColumnName.Value); } } } } return(String.Empty); }
// <summary> // Return the corresponding FunctionImport's result-column name for a given property. // </summary> internal static string GetFunctionImportResultColumnName(EntityModel.FunctionImport functionImport, EntityModel.Property property) { if (functionImport != null) { var columnName = EntityModel.FunctionImport.GetFunctionImportResultColumnName(functionImport, property); if (!String.IsNullOrEmpty(columnName)) { return(columnName); } } return(property.LocalName.Value); }
internal override bool ParseSingleElement(ICollection <XName> unprocessedElements, XElement elem) { if (elem.Name.LocalName == EntitySet.ElementName) { EntitySet es = new ConceptualEntitySet(this, elem); AddEntitySet(es); es.Parse(unprocessedElements); } else if (elem.Name.LocalName == FunctionImport.ElementName) { var fi = new FunctionImport(this, elem); _functionImports.Add(fi); fi.Parse(unprocessedElements); } else { return(base.ParseSingleElement(unprocessedElements, elem)); } return(true); }
internal void AddFunctionImport(FunctionImport fi) { _functionImports.Add(fi); }
internal ComposableDefaultableValue(FunctionImport parent) : base(parent, AttributeIsComposable) { }