nrefactory

Get all methods from C# code using NRefactory

帅比萌擦擦* 提交于 2019-12-24 04:40:56
问题 How do I retrieve all the methods in a C# program using the NRefactory API ? CSharpParser parser = new CSharpParser(); SyntaxTree tree = parser.Parse(code); This creates a SyntaxTree but how do I get ONLY the list of methods from this SyntaxTree? 回答1: There is an in depth article about using NRefactory available on CodeProject. To get information from the SyntaxTree you can either visit the nodes or use the type system. To visit the method declaration nodes you can do: var parser = new

NRefactory: How do I access unresolved Named Arguments on a Property Attribute?

被刻印的时光 ゝ 提交于 2019-12-11 03:07:56
问题 I apologize in advance for the long description of a simple question but I want to make sure people properly understand what I'm trying to do. Background I'm writing a tool that can read in a file generated by SqlMetal and create a class that contains methods for simple Inserting, Updating, Deleting and Selecting, which can then be exposed to a web service. The main advantage here is that if a table changes, I simply have to re-run the tool and the database-related code is automatically