/// <summary> /// Adds a mapping between a model function and a store function. /// </summary> /// <param name="modelFunction">Model function import to map.</param> /// <param name="storeFunction">Store function to map the model function to.</param> /// <returns>A FunctionImportMapping object representing the new mapping.</returns> public FunctionImportMapping AddMapping(ModelFunction modelFunction, StoreFunction storeFunction) { FunctionImportMapping fim = new FunctionImportMapping(base.ParentFile, _entityContainerMapping, this, modelFunction, storeFunction); _functionImportMappings.Add(fim.ModelFunction.Name, fim); fim.Removed += new EventHandler(fim_Removed); fim.ModelFunction.NameChanged += new EventHandler <NameChangeArgs>(ModelFunction_NameChanged); return(fim); }
void ModelFunction_NameChanged(object sender, NameChangeArgs e) { if (_functionImportMappings.ContainsKey(e.OldName)) { FunctionImportMapping fim = _functionImportMappings[e.OldName]; _functionImportMappings.Remove(e.OldName); _functionImportMappings.Add(e.NewName, fim); } }
void Mapping_Removed(object sender, EventArgs e) { _mapping = null; }