Esempio n. 1
0
        /// <summary>
        ///     Returns list of all s-side functions
        /// </summary>
        internal override Dictionary <MappingLovEFElement, string> GetListOfValues(ListOfValuesCollection type)
        {
            var lov = new Dictionary <MappingLovEFElement, string>();

            Debug.Assert(type == ListOfValuesCollection.FirstColumn, "Unsupported lov type was sent");

            if (type == ListOfValuesCollection.FirstColumn)
            {
                var functionImport = FunctionImportMapping.FunctionImportName.Target;
                Debug.Assert(functionImport != null, "Couldn't find FunctionImport binding");
                if (functionImport != null)
                {
                    var storageModel = EFExtensions.StorageModel(functionImport.Artifact);

                    foreach (var function in storageModel.Functions())
                    {
                        // add the Function to the list
                        lov.Add(new MappingLovEFElement(function, function.DisplayName), function.DisplayName);
                    }

                    return(lov);
                }
            }

            return(base.GetListOfValues(type));
        }
Esempio n. 2
0
        protected override void PopulateMappingForSelectedObject(EFFunctionImportDescriptor selectedObject)
        {
            Debug.Assert(selectedObject != null, "selectedObject should not be null");

            if (selectedObject != null)
            {
                AddMapping(null, Resources.NoneDisplayValueUsedForUX);
                var currentType = selectedObject.WrappedItem as FunctionImport;
                if (currentType != null &&
                    currentType.Artifact != null &&
                    EFExtensions.StorageModel(currentType.Artifact) != null)
                {
                    var functions = EFExtensions.StorageModel(currentType.Artifact).Functions();
                    foreach (var function in functions)
                    {
                        AddMapping(function, function.LocalName.Value);
                    }
                }
            }
        }