As promised at the end of previous post that I would share the source code and describe more details.
Metadata and Domain Service are both generated automatically after created new Domain Service via wizard. It should be the T4 that do this job behind the scene. Before I began implementing this Add-In, I had taken some thoughts of extending the Text Template file of metadata (.tt). This great post, MetaGen: A project metadata generator for Visual Studio using T4 written by Daniel Vaughan, was done quite the same as my thought but for another purpose.
However I want to keep away from overriding the standard that the Visual Studio provides us especially with the Beta and RC version. If the Visual Studio changes the template of metadata next month, I don’t want to find the name solid template from somewhere that up-to-date and modify it from scratch. Here is only my personal opinion and I still think that extending template for T4 is more effective for some complex requirements.
Also modifying very complex template is a bit painful. You can easily mess up the generated code by a small mistake.