<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : OData and JSON property names</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : OData and JSON property names</description>
  <pubDate>Wed, 13 May 2026 05:43:15 -700</pubDate>
  <lastBuildDate>Mon, 21 May 2012 12:50:47 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=3443</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>OData and JSON property names :    Hi Chris, Most likely, the...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3443&amp;PID=13615#13615</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 3443<br /><strong>Posted:</strong> 21-May-2012 at 12:50pm<br /><br />Hi Chris, <div>&nbsp;</div><div>Most likely, the serializer being used does not support these attributes.</div><div>The WCF serializer supports it and should take care of the problem if used.</div><div>As per <a href="http://forums.asp.net/t/1619811.aspx/1" target="_blank">http://forums.asp.net/t/1619811.aspx/1</a>, to use the WCF serializer you'll need to write a new ActionResult-derived type which calls into the WCF serializer. More details in the link provided.</div><div>&nbsp;</div><div>Regards<span style="line-height: 1.4;">.</span></div><span style="font-size:10px"><br /><br />Edited by sbelini - 05-Jan-2014 at 5:49am</span>]]>
   </description>
   <pubDate>Mon, 21 May 2012 12:50:47 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3443&amp;PID=13615#13615</guid>
  </item> 
  <item>
   <title>OData and JSON property names : Hi,I have a code first Devforce...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3443&amp;PID=13588#13588</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1111" rel="nofollow">cseils</a><br /><strong>Subject:</strong> 3443<br /><strong>Posted:</strong> 16-May-2012 at 5:21pm<br /><br /><div>Hi,</div><div><br></div><div>I have a code first Devforce BOS which has OData set up. &nbsp;I am accessing the data from an iOS device in the JSON format which works fine.</div><div>However I want the property names in the JSON to be slightly different from the property names I have written in .NET.</div><div>I read that I can add an attribute to each property and the output with reflect the name configured. &nbsp;See the following code:</div><div><br></div><div>&#091;ProvideEntityAspect&#093;</div><div>&#091;IgnoreProperties(@"EntityAspect", @"AAAA_EntityAspectForSerialization")&#093;</div><div>&#091;DataServiceKey(@"Id")&#093;</div><div>public class ProductCategory</div><div>{</div><div>&nbsp; &nbsp; DataMember(Name="id")&#093;</div><div>&nbsp; &nbsp; public Guid Id { get; set; }</div><div><br></div><div>&nbsp; &nbsp; &#091;Required, MaxLength(20)&#093;</div><div>&nbsp; &nbsp; &#091;DataMember(Name = "code")&#093;</div><div>&nbsp; &nbsp; public string Code { get; set; }</div><div><br></div><div>&nbsp; &nbsp; &#091;MaxLength(50)&#093;</div><div>&nbsp; &nbsp; &#091;DataMember(Name = "name")&#093;</div><div>&nbsp; &nbsp; public string Name { get; set; }</div><div><br></div><div>&nbsp; &nbsp; &#091;Required&#093;</div><div>&nbsp; &nbsp; &#091;DataMember(Name = "trackUnitsInStock")&#093;</div><div>&nbsp; &nbsp; public bool TrackUnitsInStock { get; set; }</div><div>}</div><div><br></div><div>However, even with these attributes configured, the JSON is:</div><div><br></div><div>{"d" : &#091;"Id": "d4ea92f5-9008-4e8f-b695-11967d87afd6", "Code": "01", "Name": "Test", "TrackUnitsInStock": true&#093;}</div><div><br></div><div>The property names are still the capitalized .net properties.</div><div>Is there an attribute that DevForce will use so I can change the names of the properties in the JSON or AtomPub?&nbsp;</div><div>I really don't want to have to go through all my code and rename all the properties to match the iOS core data equivalent.</div><div>I know I have to do it with .net attributes anyway, but I would like the underlying database to have proper capitalized field names.</div><div><br></div><div>Thanks in advanced.</div><div>Chris</div>]]>
   </description>
   <pubDate>Wed, 16 May 2012 17:21:31 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3443&amp;PID=13588#13588</guid>
  </item> 
 </channel>
</rss>