Compile() public static method

public static Compile ( string source, string name, string queryText, OrderedPartCollection extensions, string basePath ) : Type
source string
name string
queryText string
extensions OrderedPartCollection
basePath string
return System.Type
Esempio n. 1
0
        public AbstractViewGenerator GenerateInstance()
        {
            TransformQueryToClass();
            string tempFileName = null;

            try
            {
                try
                {
                    tempFileName = Path.GetTempFileName();
                    File.WriteAllText(tempFileName, CompiledQueryText);
                }
                catch (Exception)
                {
                    throw new InvalidOperationException(@"Raven could not write to the temp directory.
This is usually the result of security settings when running in IIS.
Raven requiers access to the temp directory in order to compile indexes.");
                }
                GeneratedType = QueryParsingUtils.Compile(tempFileName, CSharpSafeName, CompiledQueryText, extensions);
            }
            finally
            {
                if (tempFileName != null)
                {
                    File.Delete(tempFileName);
                }
            }
            return((AbstractViewGenerator)Activator.CreateInstance(GeneratedType));
        }
Esempio n. 2
0
        public AbstractViewGenerator GenerateInstance()
        {
            TransformQueryToClass();

            GeneratedType = QueryParsingUtils.Compile(CompiledQueryText, CSharpSafeName, CompiledQueryText, extensions, basePath);

            return((AbstractViewGenerator)Activator.CreateInstance(GeneratedType));
        }
Esempio n. 3
0
        public AbstractTransformer GenerateInstance()
        {
            TransformToClass();
            GeneratedType = QueryParsingUtils.Compile(CompiledQueryText, CSharpSafeName, CompiledQueryText, extensions, basePath, configuration);

            var abstractTransformer = (AbstractTransformer)Activator.CreateInstance(GeneratedType);

            abstractTransformer.SourceCode = CompiledQueryText;
            abstractTransformer.Init(transformerDefinition);
            return(abstractTransformer);
        }