<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>Supporting OData CRUD Operations</title><link>http://www.asp.net</link><pubDate>Tue, 21 May 2013 04:30:18 GMT</pubDate><generator>umbraco</generator><description>Comments for Supporting OData CRUD Operations</description><language>en</language><atom:link href="http://www.asp.net/rss/comments/43778" rel="self" type="application/rss+xml" /><item><title>Comment Posted by breyed</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-crud-operations</link><pubDate>Fri, 08 Mar 2013 10:57:18 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018622</guid><description><![CDATA[ <p>The samples that modify the database all appear to contain race conditions. The boilerplate code generated by Visual Studio for a new Web API with EF controller contains catches blocks for DbUpdateConcurrencyException. Is there some similar technique to address changes that may occur, say, between _context.Products.Any and SaveChanges? Additionally, calling Any followed by SaveChanges involves two database round trips. Is there a best practice to make only one?</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/breyed.jpg?forceidenticon=false&amp;dt=635047469400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by breyed</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-crud-operations</link><pubDate>Fri, 08 Mar 2013 11:03:31 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018623</guid><description><![CDATA[ <p>The banner on top saying &quot;This topic describes pre-release features&quot; is out of date. OData over ASP.NET Web API is now a stable release.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/breyed.jpg?forceidenticon=false&amp;dt=635047469400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by breyed</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-crud-operations</link><pubDate>Fri, 08 Mar 2013 17:49:34 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018635</guid><description><![CDATA[ <p>This StackOverflow question demonstrates a way to doing updates that avoids the race condition and the extra database round trip:</p><p></p><p><a rel="nofollow" href="http://stackoverflow.com/q/15298351/145173" target="_blank">stackoverflow.com/</a></p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/breyed.jpg?forceidenticon=false&amp;dt=635047469400000000&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/odata-support-in-aspnet-web-api/supporting-odata-crud-operations</link><pubDate>Mon, 11 Mar 2013 18:53:42 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018657</guid><description><![CDATA[ <p>@breyed: Thanks for the comments. I&#39;ll remove the pre-release note and update the example code to use RaghuRam&#39;s approach.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/MikeWasson.jpg?forceidenticon=false&amp;dt=635047469400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by stevo.zilik</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-crud-operations</link><pubDate>Tue, 12 Mar 2013 21:15:09 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018676</guid><description><![CDATA[ <p>Hi Mike, great work. Question regarding CRUD (create for now). The Request Form Body as Json:</p><p></p><p>{&quot;Id&quot;:&quot;&quot;,&quot;ModFamilyId&quot;:&quot;80daa9a1-f482-4ad7-b6e3-7a9ae3483a0e&quot;,&quot;FromSessionId&quot;:8,&quot;FromSessionName&quot;:&quot;&quot;&quot;__metadata&quot;:{&quot;type&quot;:&quot;LiveRacers.Web.ApiModels.ModMappingModel&quot;}}</p><p></p><p>In EntitySetController Post, the &#39;entity&#39; is null. The Model defines all those properties (except the __metadata). Same solution works with pure Web Api. Any idea why the request form body json data is not serialized into a new model?</p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/stevo.zilik.jpg?forceidenticon=false&amp;dt=635047469400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by aconsolati</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-crud-operations</link><pubDate>Wed, 13 Mar 2013 02:50:44 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018678</guid><description><![CDATA[ <p>@stevo.zilik I also have the entity parameter being passed as null into both the CreateEntity and UpdateEntity methods of my EntitySetController-derived class.  I&#39;m sending the payload from Fiddler.</p><p></p><p>The post body I&#39;m sending is plain JSON with the correct entity properties and no metadata:</p><p></p><p>{&quot;Entry_Code&quot;:543,&quot;Clipboard_Code&quot;:388,&quot;Clinic_Code&quot;:1,&quot;Client_Number&quot;:&quot;ABC123&quot;,&quot;Patient_Number&quot;:&quot;XYZ&quot;,&quot;Consultation_Number&quot;:null}</p><p></p><p>The content type for the header is set to:</p><p>Content-Type: application/json;</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/aconsolati.jpg?forceidenticon=false&amp;dt=635047469400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by aconsolati</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-crud-operations</link><pubDate>Thu, 14 Mar 2013 19:17:20 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018703</guid><description><![CDATA[ <p>@stevo.zilik OK, I have resolved this issue with entity being passed as null. </p><p></p><p>First install latest nightly for OData via PM console:</p><p></p><p>Install-Package Microsoft.AspNet.WebApi.OData -Source <a rel="nofollow" href="http://www.myget.org/F/aspnetwebstacknightly/" target="_blank">www.myget.org/</a> -Pre</p><p></p><p>This updated 4 assemblies, including Microsoft.AspNet.WebApi.OData 4.0.0 to 5.0.0-alpha-130314.</p><p></p><p>Note I also had to specify charset in PUT request as:</p><p></p><p>Content-Type: application/json; charset=utf-8</p><p></p><p>Hope that helps you</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/aconsolati.jpg?forceidenticon=false&amp;dt=635047469400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by stevo.zilik</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-crud-operations</link><pubDate>Fri, 15 Mar 2013 14:31:23 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018710</guid><description><![CDATA[ <p>@aconsolati - thanks mate, but its still not working... can you try a POST request?</p><p></p><p>I&#39;ve updated the package to 5.0.0-alpha-130315 and set the Content-Type	application/json; charset=utf-8, still null</p><p></p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/stevo.zilik.jpg?forceidenticon=false&amp;dt=635047469400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by stevo.zilik</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-crud-operations</link><pubDate>Sat, 16 Mar 2013 09:02:29 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018715</guid><description><![CDATA[ <p>Hi Mike, would it be possible to post some working examples of using odata CRUD with json javascript client. Currently I&#39;m struggling to get anything working with the odata routing...</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/stevo.zilik.jpg?forceidenticon=false&amp;dt=635047469400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by dmaxwell</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-crud-operations</link><pubDate>Tue, 02 Apr 2013 21:48:05 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018832</guid><description><![CDATA[ <p>It would be nice to see examples using Fiddler2 or JavaScript working together with these OData services.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/dmaxwell.jpg?forceidenticon=false&amp;dt=635047469400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by BrunoMon</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-crud-operations</link><pubDate>Thu, 11 Apr 2013 11:01:58 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018893</guid><description><![CDATA[ <p>Hi Mike, great post!</p><p>I need to obtain an updated entity in the browser, but the Odata response status code for put operations is 204 (No Content).</p><p>Is there any way to send the updated entity back to the client ?</p><p>thanks</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/BrunoMon.jpg?forceidenticon=false&amp;dt=635047469400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by DamianReeves</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-crud-operations</link><pubDate>Thu, 16 May 2013 10:27:51 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000019117</guid><description><![CDATA[ <p>Mike is there a way to generate service references that reuse a shared type like in other WCF based services. For my .NET Client it would be nice if I could use a type from a shared assembly.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/DamianReeves.jpg?forceidenticon=false&amp;dt=635047469400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Appiez</title><link>http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-crud-operations</link><pubDate>Tue, 21 May 2013 04:30:18 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000019149</guid><description><![CDATA[ <p>Mike, thanks for the tutorials. I learned a lot from them.</p><p></p><p>Past weekend i&#39;ve created a odata service myself and some things took me a while to figure out, therefor i will share them with other readers. But, because the comments are limited to a certain characters, i&#39;ve placed it on pastebin:</p><p></p><p><a rel="nofollow" href="http://pastebin.com/RgT1cKPF" target="_blank">pastebin.com/</a></p><p></p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/Appiez.jpg?forceidenticon=false&amp;dt=635047469400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item></channel></rss>