It is a Visual Item Template to create DTO classes from Entities. These entity classes are usually generated using the Entity Framework. We have Item template to create Entities by mentioning the tables from our database, but we do not have any measures to create DTO classes from entities which are necessary in on-wire applications. Thus, we have created one, a Visual C# item template, which can create DTO classes(in C#) from the entities.
To achieve this, you need to install two setups:
First file is a VSIX file which will upload a Visual Item Template for your Visual Studio and second file is a setup file, which will install the supporting DLL file and also register it on your Global Assembly Cache.
Simply import the template in your VS 2010 OR double click the VSIX file. Then install the setup given. Now, when a developer will create a new item for his/her project, then he/she can see a template called ‘DTO generator’ as shown in the screenshot below:
Select that template and the developer will be asked for the Entity assembly.
The developer has to enter the path of assembly which contains the entities. As developer presses ‘OK’ button, the DTO classes will be generated in his/her project, as shown below:
The DTO classes created will be PARTIAL classes. User will also have choice to select the entities from the selected assembly to create the respective DTO classes. This will happen when user selects the assembly, the list of entities will displayed in a dialog, as shown below:
User has the choice now to exclude entities whose DTOs classes should not be created.
That’s all we have for you now. Suggestions and comments are welcome though our contact