<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Tutorial: Your First Web API</title><link>http://www.asp.net</link><pubDate>Wed, 16 May 2012 16:18:00 GMT</pubDate><generator>umbraco</generator><description>Comments for Tutorial: Your First Web API</description><language>en</language><atom:link href="http://www.asp.net/rss/comments/36873" rel="self" type="application/rss+xml" /><item><title>Comment Posted by mgmoody</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Sat, 18 Feb 2012 22:07:15 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014875</guid><description><![CDATA[ <p>Disappointing start. In the 1st code example the closing head tag in Index.cshtml is omitted.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/mgmoody.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by nandodixtorsion</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Sun, 19 Feb 2012 10:34:40 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014880</guid><description><![CDATA[ <p>if (id &lt; 1 || id &gt; 3)</p><p>    {</p><p>        throw new HttpResponseException(System.Net.HttpStatusCode.NotFound);</p><p>    }</p><p></p><p></p><p>&quot;...we set the product name to &quot;Gizmo id&quot;. For example, if the user requests ID = 4, the method returns &quot;Gizmo 4&quot;.   </p><p></p><p>It does&#39;t return &quot;Gizmo 4&quot; it throws an exception, doesn&#39;t it?</p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/nandodixtorsion.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by mdasif6178</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Tue, 21 Feb 2012 05:53:25 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014899</guid><description><![CDATA[ <p>very helpful article..</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/mdasif6178.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by neon2</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Wed, 22 Feb 2012 01:08:13 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014910</guid><description><![CDATA[ <p>the route is very much lose couple, i found it not good.</p><p>The request is a GET request, so the framework looks for a method on ProductsController whose name starts with &quot;Get...&quot;</p><p>It is not at all fine</p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/neon2.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by abhimanyu kumar vatsa</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Thu, 23 Feb 2012 04:45:30 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014920</guid><description><![CDATA[ <p>one of the great addition in MVC here...thanks Microsoft</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/abhimanyu%20kumar%20vatsa.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by irfan hyderabad</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Fri, 24 Feb 2012 07:47:08 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014932</guid><description><![CDATA[ <p>How to unit test?</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/irfan%20hyderabad.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by robertmazzo</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Wed, 29 Feb 2012 17:12:09 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014983</guid><description><![CDATA[ <p>Hi,</p><p>Based on this line above:</p><p></p><p>To get a list of products, send an HTTP GET request to &quot;/api/products&quot;</p><p></p><p>how does the http request know about api/products ? Is that based on the ProductsController.cs file that we created above ? Is the name &quot;Products&quot; understood here ?</p><p></p><p>Please clarify, and I apologize if I missed something in my reading...</p><p></p><p>regards,</p><p>Bob</p><p></p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/robertmazzo.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by arashkarami</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Thu, 01 Mar 2012 12:14:11 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014992</guid><description><![CDATA[ <p>Thanks for great post.</p><p>I downloaded MVC4 and install it but i was not found WebAPI template project!Are u have a solution for my problem?</p><p>Please put your solution (source code) for download.Thanks again</p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/arashkarami.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by arashkarami</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Thu, 01 Mar 2012 12:24:31 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014993</guid><description><![CDATA[ <p>Thank, I found it in previous your videos :)</p><p>Add a new routing:</p><p>routes.MapHttpRoute(</p><p>                    name: &quot;DefaultApi&quot;,</p><p>                    routeTemplate: &quot;api/{controller}/{id}&quot;,</p><p>                    defaults: new { id = RouteParameter.Optional }</p><p>            );</p><p>Thanks again</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/arashkarami.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by phantasm33</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Sun, 04 Mar 2012 22:51:54 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015018</guid><description><![CDATA[ <p>Question: do I have to put my controller class inside of the &quot;Controllers&quot; folder or can I locate it inside of, let&#39;s say, an &quot;Api&quot; folder instead?</p><p></p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/phantasm33.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by SunnySetia</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Tue, 06 Mar 2012 21:37:24 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015040</guid><description><![CDATA[ <p>Hi, This is very helpful article.</p><p>I have one question. If we have 2 methods in products controller without parameter, i.e one as mentioned above</p><p>public IEnumerable&lt;Product&gt; GetAllProducts()</p><p>{</p><p>------</p><p>}</p><p>suppose other we have </p><p>public IEnumerable&lt;Product&gt; GetFirstProducts()</p><p>{</p><p>------</p><p>}</p><p></p><p>How we can call GetFirstProduct() method?</p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/SunnySetia.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by anirudhsirohi</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Thu, 08 Mar 2012 11:24:16 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015064</guid><description><![CDATA[ <p>Visual studio takes for ever to modify JavaScript in Index.cshtml</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/anirudhsirohi.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by czoch</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Thu, 08 Mar 2012 18:31:45 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015068</guid><description><![CDATA[ <p>anirudhsirohi - I had the same problem.  30-40 second pauses after pressing &lt;Enter&gt; while editing .cshtml with razor.  It stopped after I switched the indenting to &quot;None&quot; in (Tools -&gt; Options -&gt; Text Editor -&gt; HTML -&gt; Tabs).</p><p></p><p>I switched it back to &quot;Block&quot;, and it seems fine.  Smart is disabled.</p><p></p><p>I got the idea from this suggestion for VS11:</p><p><a rel="nofollow" href="http://blogs.msdn.com/b/webdevtools/archive/2012/03/06/visual-studio-11-beta-razor-editor-issue-workaround.aspx" target="_blank">blogs.msdn.com/</a></p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/czoch.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by MikeWasson</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Fri, 09 Mar 2012 10:44:46 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015072</guid><description><![CDATA[ <p>@mgmoody: Thanks, fixed.</p><p></p><p>@nandodixtorsion: Thanks, fixed -- I changed the code and forgot to update the text.</p><p></p><p>@robertmazzo: Yes, it looks to match the variable {controller} in the route with the name of the controller.</p><p></p><p>@phantasm33: No, the folder name is not important. It&#39;s just a way to organize your source files. </p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/MikeWasson.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by fwahl</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Wed, 14 Mar 2012 09:57:40 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015123</guid><description><![CDATA[ <p>Very nice tutorial. Thank you.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/fwahl.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by joa_and</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Wed, 14 Mar 2012 11:04:24 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015124</guid><description><![CDATA[ <p>Code like</p><p>throw new HttpResponseException(System.Net.HttpStatusCode.NotFound); </p><p>Doesn’t work on a server for HTTP status of 400 and upwards the IIS is hijacking your error message and replacing it with his own.</p><p>See:</p><p><a rel="nofollow" href="http://stackoverflow.com/questions/9688118/deploying-asp-net-mvc-4-web-api" target="_blank">stackoverflow.com/</a></p><p></p><p>-Any solution?</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/joa_and.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by gergob</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Wed, 21 Mar 2012 05:12:50 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015175</guid><description><![CDATA[ <p>very nice article, very easy to understand if you have some MVC knowledge in the back, Thank you!</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/gergob.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by icelava</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Tue, 27 Mar 2012 06:58:55 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015203</guid><description><![CDATA[ <p>I think some clarification of HttpRouteCollection vs RouteCollection is in order, and what should be placed properly in global.asax startup.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/icelava.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by raulhmacias</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Thu, 19 Apr 2012 19:26:22 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015369</guid><description><![CDATA[ <p>very helpful article to get started with web api</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/raulhmacias.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by simplymanas</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Sat, 28 Apr 2012 09:01:30 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015429</guid><description><![CDATA[ <p>nice start.. step by step</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/simplymanas.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ilich</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Thu, 10 May 2012 18:53:34 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015480</guid><description><![CDATA[ <p>Nice stuff! Too late unfortunately, WCF ate all my brain already (( </p><p>Now I&#39;m stupid xml programmer :-P</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/ilich.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by wishstar99</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Wed, 16 May 2012 12:56:28 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015521</guid><description><![CDATA[ <p>Great tutorial. Thank you.</p><p></p><p>One question, how do you call a function with two parameters?</p><p></p><p>GetProductByIdName(int id, string pname) ?</p><p></p><p>api/products/id ...??</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/wishstar99.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by wishstar99</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Wed, 16 May 2012 13:02:35 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015523</guid><description><![CDATA[ <p>I also have the same question as SunnySetia&#39;s.</p><p></p><p>GetAllProducts()</p><p>GetFilteredProducts()</p><p></p><p>How does the api know which one to pull?</p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/wishstar99.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by pbulloch</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Wed, 16 May 2012 13:28:03 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015524</guid><description><![CDATA[ <p>Extraordinarily clear.  Nice work. </p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/pbulloch.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by renatohaddad</title><link>http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api</link><pubDate>Wed, 16 May 2012 16:18:00 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015534</guid><description><![CDATA[ <p>Congrats Mike, nice article, simple and objective. Can you publish an article using 2 or more entities with relationships?</p><p>Renato Haddad</p><p>MVP</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/renatohaddad.jpg?forceidenticon=false&amp;dt=635072292000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item></channel></rss>