codegen

How do I extract the names from a simple function?

I've got this piece of code: import inspect import ast def func(foo): return foo.bar - foo.baz s = inspect.getsource(func) xx = ast.parse(s) class VisitCalls(ast.NodeVisitor): def visit_Name(self, what): if what.id == 'foo': print ast.dump(what.ctx) VisitCalls().visit(xx) From function 'func' I'd like t...

Where is TextTransform.exe Located on Hard drive?

Where is TextTransform.exe located? I'm trying to implement the solution in this post: http://stackoverflow.com/questions/1646580/get-visual-studio-to-run-a-t4-template-on-every-build However I'm getting an error "'TextTransform.exe' is not recognized as an internal or external command, operable program or batch file." I have been l...

C# Reflection, changing a method's body

Hi everyone! Is it possible to change the body of method during runtime? class Person { public void DoSth() { Console.WriteLine("Hello!"); } } I wanted to have a simple input field (like a textbox) where I can write the method body source code during runtime. The textbox may contain data like: for (int i = 0; i < 5; i++) ...

Generating simple CRUD stored procs

I'm working on a project that is subject to certain corporate standards relating to SQL implementation. Specifically, that all SQL Server content be accessed only via stored proc. (No ORM or LINQ.) 80% or more of our needs can be handled through the basic CRUD (CREATE, READ, UPDATE, DELETE) type of procedure that should be fairly si...