Exemple #1
0
        public Compilation Provide()
        {
            var code = _codeProvider
                       .Provide();

            var syntaxTree = _syntaxTreeProvider
                             .WithCode(code)
                             .Provide();

            var assemblyName       = _fileNameProvider.Provide();
            var references         = _referenceProvider.Provide();
            var compilationOptions = _compilationOptionProvider.Provide();

            var compilation = CSharpCompilation.Create(
                assemblyName,
                new[] { syntaxTree },
                references,
                compilationOptions);

            return(compilation);
        }