Inheritance: CodeTemplateBase
    /// <summary>
    /// Generate and build access assembly.
    /// The built assembly has a class with a property for each 
    /// persistable type on the schema returning a IEnumerator.
    /// Also a constructor that connects to db and a function to
    /// close the connection.
    /// </summary>
    /// <param name="pAssemblyName">Name of the generated assembly</param>
    /// <param name="pNamespace">Namespace of the generated class</param>
    /// <param name="pTypeName">Name of the generated class</param>
    /// <param name="pInMemory">Choose if generate in memory or 
    /// on disk</param>
    /// <returns>The generated assembly.</returns>
    public Assembly BuildAssembly(AssemblyName pAssemblyName, string pNamespace, string pTypeName, bool pInMemory)
    {
      string lCode;
      CodeTemplate lGenerator = new CodeTemplate()
      {
        NameSpace = pNamespace,
        TypeName = pTypeName,
        Schema = schema,
        SessionInfo = sessionInfo
      };
      // Generate access code from CodeTemplate.tt.
      lCode = lGenerator.TransformText();

      return GenerateAssembly(lCode, pAssemblyName, pInMemory);
    }
Exemplo n.º 2
0
        /// <summary>
        /// Generate and build access assembly.
        /// The built assembly has a class with a property for each
        /// persistable type on the schema returning a IEnumerator.
        /// Also a constructor that connects to db and a function to
        /// close the connection.
        /// </summary>
        /// <param name="pAssemblyName">Name of the generated assembly</param>
        /// <param name="pNamespace">Namespace of the generated class</param>
        /// <param name="pTypeName">Name of the generated class</param>
        /// <param name="pInMemory">Choose if generate in memory or
        /// on disk</param>
        /// <returns>The generated assembly.</returns>
        public Assembly BuildAssembly(AssemblyName pAssemblyName, string pNamespace, string pTypeName, bool pInMemory)
        {
            string       lCode;
            CodeTemplate lGenerator = new CodeTemplate()
            {
                NameSpace   = pNamespace,
                TypeName    = pTypeName,
                Schema      = schema,
                SessionInfo = sessionInfo
            };

            // Generate access code from CodeTemplate.tt.
            lCode = lGenerator.TransformText();

            return(GenerateAssembly(lCode, pAssemblyName, pInMemory));
        }