Beispiel #1
0
        /// <summary>
        /// Save CRUD stored procedures in a script.
        /// </summary>
        /// <param name="sprocs"></param>
        /// <param name="path"></param>
        /// <param name="filename"></param>
        public void SaveSProcsToFile(StoreProcedureStream[] sprocs,string path,string filename)
        {
            StringBuilder temp = new StringBuilder();
            foreach (StoreProcedureStream _stream in sprocs)
            {
                temp.Append(_stream.Text);
            }

            SaveToFile(path, filename, temp.ToString());
        }
Beispiel #2
0
 /// <summary>
 /// Save mapping O/R data in a XML file.
 /// </summary>
 /// <param name="sprocs"></param>
 /// <param name="path"></param>
 /// <param name="filename"></param>
 public void SaveMappingsToFile(StoreProcedureStream[] sprocs,string path,string filename)
 {
     //TODO: set header and footer xml doc
     StringBuilder temp = new StringBuilder();
     foreach (StoreProcedureStream _stream in sprocs)
     {
         temp.Append(_stream.Mappings.Text);
     }
     XmlDocumentString mappingsXML = new XmlDocumentString("mappings", temp.ToString());
     SaveToFile(path, filename, mappingsXML.Text);
 }
Beispiel #3
0
 /// <summary>
 /// Implementation of the mapping stream using the stored procedures stream.
 /// Use a template method for generate the code by derivated classes.
 /// </summary>
 /// <param name="sprocs"></param>
 public void SetStreamFromProcedures(StoreProcedureStream sprocs)
 {
     _sprocs=sprocs;
         //template method
        GenerateMappingsStream();
 }