Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.NET Web API action method support in JQuery with intellisense
    primarykey
    data
    text
    <p>ASP.NET Web API action methods return JSON result and are called through JQuery in my project. I found that for this I ended up writing almost similar code for all action methods. Moreover I felt my approach gets bit more complicated when I pass classes (normal or nested). I have to call JSON.stringfy to normalize it.</p> <p>Keeping this mind I started out with writting T4 template which will generate these calling mechanisms for me with all parameters. Though its early in process I am looking for good suggestions to achieve this. Following are the steps I am planning to follow in same.</p> <ul> <li>Get Core Assembly where ApiController resides</li> <li>Identify ApiController classes</li> <li>Identify action methods in given ApiController class</li> <li>Identify extra properties of action method like custom route, get or post</li> <li>Identify parameters of method</li> <li>Identify if any parameter is complex (class)</li> <li>Identify members of complex type (recursive if member is also complex)</li> <li>identify if any parameter is Array - perform above 3 steps for its base type</li> <li>[optional] Identify return type and perform above 4 steps, <ul> <li><em>optional cause I do not have direct use of it.</em></li> </ul></li> <li>Generate JavaScript based on above information.</li> <li>Generate Documentation for above methods based on available documentation for methods and parameters. <ul> <li><em>Am totally black about this option. I feel this option is pretty important as there is good chance of typos in complex handling.</em></li> </ul></li> </ul> <p>I have already did my searching and could not find any T4 template which does this. Frankly am bit surprised on this part, as I find it so obivious for working on complex applications with Web Api.</p> <p><strong>Questions</strong></p> <ul> <li>Does this idea sounds feasible?</li> <li>Is there any project which already does this?</li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload