codesmith

How to use current stored procedure of database in code smith for create template?


I have a data base and create more stored procedure it,now i want use currently created stored procedures in code smith and create template from it. What to do?

For example for use from table in code generator write the follow property :

<%@ Property Name="SourceTables" Category="Database" Optional="True" Type="SchemaExplorer.TableSchemaCollection" 
Description="The database tables" %>

How to Write for stored procedures ????

<%@ Property ..... Type="**SchemaExplorer.???**" ...

Solution

  • I work for CodeSmith Tools and there is already a template that does what you want to create stored procedures. It can be found in the Database/StoredProcedures folder. The source can also be found online here.

    If you wish to interact with a stored procedure via a property you can do this via the CommandSchema type.

    <%@ Property Name="SourceCommands" Category="Database" Optional="True" Type="SchemaExplorer.CommandSchemaCollection" 
    Description="The database stored procedures" %>