Ejemplo n.º 1
0
 public static string GenerateContract(ApiContractGenerator generator, string sourceCode, Microsoft.CodeAnalysis.CSharp.LanguageVersion languageVersion, IAssemblyReferenceResolver assemblyResolver = null)
 {
     using var stream = new MemoryStream();
     EmitCompilation(sourceCode, stream, languageVersion);
     return(GenerateContract(generator, stream, assemblyResolver));
 }
Ejemplo n.º 2
0
 public static void EmitCompilation(string sourceCode, Stream target, Microsoft.CodeAnalysis.CSharp.LanguageVersion languageVersion)
 {
     EmitCompilation(
         BaseCSharpCompilation.Value.AddSyntaxTrees(CSharpSyntaxTree.ParseText(sourceCode, new CSharpParseOptions(languageVersion))),
         target);
 }