예제 #1
0
        /// <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);
        }
예제 #2
0
 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);
     }
 }
예제 #3
0
 void Mapping_Removed(object sender, EventArgs e)
 {
     _mapping = null;
 }