private static EntityDesignNewFunctionImportResult ShowNewFunctionImportDialog( Function selectedSproc, string selectedSprocName, StorageEntityModel sModel, ConceptualEntityModel cModel, ConceptualEntityContainer cContainer, string dialogTitle, Object selectedObject) { using (var dialog = new NewFunctionImportDialog( selectedSproc, selectedSprocName, sModel.Functions(), cModel.ComplexTypes(), cModel.EntityTypes(), cContainer, selectedObject)) { dialog.Text = dialogTitle; var dialogResult = dialog.ShowDialog(); var result = new EntityDesignNewFunctionImportResult { DialogResult = dialogResult, Function = dialog.Function, FunctionName = dialog.FunctionImportName, IsComposable = dialog.IsComposable, ReturnType = dialog.ReturnType, Schema = dialog.Schema }; return(result); } }
private void RecordFunctions(StorageEntityModel sem) { foreach (var f in sem.Functions()) { var dbObj = DatabaseObject.CreateFromFunction(f); _allFunctions.Add(dbObj, f.LocalName.Value); } }
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) { StorageEntityModel storageModel = null; if (Function != null) { storageModel = Function.EntityModel; } else { // this is a creator node, so get the list from the artifact var entity = MappingFunctionEntityType.ModelItem as EntityType; storageModel = entity.Artifact.StorageModel(); } if (Function != null) { // add the row at the top that the user can click on to remove the item lov.Add(LovDeletePlaceHolder, LovDeletePlaceHolder.DisplayName); } var functions = new List <Function>(); functions.AddRange(storageModel.Functions()); if (functions.Count == 0) { if (Function == null) { lov.Add(LovEmptyPlaceHolder, LovEmptyPlaceHolder.DisplayName); } } else { // add those remaining in our list foreach (var func in functions) { // adding the Function to the list lov.Add(new MappingLovEFElement(func, func.DisplayName), func.DisplayName); } } return(lov); } return(base.GetListOfValues(type)); }
private static Dictionary <DatabaseObject, Function> ConstructDatabaseObjectToFunctionMappings(StorageEntityModel sem) { Debug.Assert(null != sem, "was passed a null StorageEntityModel"); var mappings = new Dictionary <DatabaseObject, Function>(); if (null != sem) { foreach (var func in sem.Functions()) { var dbObj = DatabaseObject.CreateFromFunction(func); mappings.Add(dbObj, func); } } return(mappings); }
private void RecordFunctions(StorageEntityModel sem) { foreach (var f in sem.Functions()) { var dbObj = DatabaseObject.CreateFromFunction(f); _allFunctions.Add(dbObj, f.LocalName.Value); } }
private static EntityDesignNewFunctionImportResult ShowNewFunctionImportDialog( Function selectedSproc, string selectedSprocName, StorageEntityModel sModel, ConceptualEntityModel cModel, ConceptualEntityContainer cContainer, string dialogTitle, Object selectedObject) { using (var dialog = new NewFunctionImportDialog( selectedSproc, selectedSprocName, sModel.Functions(), cModel.ComplexTypes(), cModel.EntityTypes(), cContainer, selectedObject)) { dialog.Text = dialogTitle; var dialogResult = dialog.ShowDialog(); var result = new EntityDesignNewFunctionImportResult { DialogResult = dialogResult, Function = dialog.Function, FunctionName = dialog.FunctionImportName, IsComposable = dialog.IsComposable, ReturnType = dialog.ReturnType, Schema = dialog.Schema }; return result; } }