1. Michael Kramer
  2. SnapObjects
  3. Friday, 2 August 2019 16:27 PM UTC

How can I change the code template SnapDevelop uses when I create new "API Controller Class"?

Initially I want to

  • decouple action names in route from method names in the controller
  • - and - rename HttpPost method Update => Insert
  • - and - rename the HttpPut method Add => Update
  • - and - add an extra HttpPatch method => PartialUpdate

Later maybe add my own custom templates, like add extra decoration for [Route...] and [Produces...].

I expect some file somewhere contains the template. But I don't know where to search for it.

TIA /Michael

Michael Kramer Accepted Answer Pending Moderation
  1. Friday, 2 August 2019 18:42 PM UTC
  2. SnapObjects
  3. # 1

So I finally found the set of folders containing the templates.

  • Templates Root
    C:\Program Files (x86)\Appeon\SnapDevelop 2019\Tools\Common7\IDE
  • API Controller Class
    C:\Program Files (x86)\Appeon\SnapDevelop 2019\Tools\Common7\IDE\ItemTemplates\CSharp\Controller

Seems like I should create a new GUID for each new template.

For now, I'm happy that I can fix the method name mix-up POST => Update while PUT => Add.

HTH /Michael

 

 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.