internal StoreFunctionParameter(EDMXFile parentFile, StoreFunction storeFunction, string name, int ordinal, XmlElement parentTypeElement) : base(parentFile) { _parentFunction = storeFunction; _parameterElement = EDMXDocument.CreateElement("Parameter", NameSpaceURIssdl); if (ordinal > 0) { XmlNodeList propertyNodes = parentTypeElement.SelectNodes("ssdl:Parameter", NSM); if (propertyNodes.Count >= ordinal) { parentTypeElement.InsertAfter(_parameterElement, propertyNodes[ordinal - 1]); } else { parentTypeElement.AppendChild(_parameterElement); } } else { parentTypeElement.AppendChild(_parameterElement); } this.Name = name; }
/// <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); }
internal FunctionImportMapping(EDMXFile parentFile, XmlElement entityContainerMappingElement, CSMapping csMapping, ModelFunction modelFunction, StoreFunction storeFunction) : base(parentFile) { _csMapping = csMapping; _modelFunction = modelFunction; _modelFunction.NameChanged += new EventHandler <NameChangeArgs>(ModelFunction_NameChanged); _modelFunction.Removed += new EventHandler(ModelFunction_Removed); _storeFunction = storeFunction; _storeFunction.Removed += new EventHandler(StoreFunction_Removed); }
/// <summary> /// Adds a store function. /// </summary> /// <param name="name">Function name.</param> /// <returns>A new StoreFunction object.</returns> public StoreFunction AddFunction(string name) { if (!Functions.Where(sf => sf.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)).Any()) { StoreFunction sf = new StoreFunction(ParentFile, this, name); _storeFunctions.Add(name, sf); sf.NameChanged += new EventHandler <NameChangeArgs>(sfn_NameChanged); sf.Removed += new EventHandler(sfn_Removed); return(sf); } else { throw new ArgumentException("A function with the name " + name + " already exist in the model."); } }
/// <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 StoreFunction_Removed(object sender, EventArgs e) { this.Remove(); _storeFunction = null; }
internal StoreFunctionParameter(EDMXFile parentFile, StoreFunction parentFunction, XmlElement parameterElement) : base(parentFile) { _parentFunction = parentFunction; _parameterElement = parameterElement; }
/// <summary> /// Adds a store function. /// </summary> /// <param name="name">Function name.</param> /// <returns>A new StoreFunction object.</returns> public StoreFunction AddFunction(string name) { if (!Functions.Where(sf => sf.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)).Any()) { StoreFunction sf = new StoreFunction(ParentFile, this, name); _storeFunctions.Add(name, sf); sf.NameChanged += new EventHandler<NameChangeArgs>(sfn_NameChanged); sf.Removed += new EventHandler(sfn_Removed); return sf; } else { throw new ArgumentException("A function with the name " + name + " already exist in the model."); } }