0

Faced with the problem of OData get JSON accordingly style Model EF.

{
   Name: "..",
   Number: 123
}

According to information on the Internet set CamelCase in WebAPI do line

config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();

In OData line not worked.

How in OData set in return JSON CamelCase? OR How in Client convert complex JSON в JSON with field CamelСase?

Jongware
  • 22,200
  • 8
  • 54
  • 100
  • I wonder if posting the question in Russian will actually help as this is a English speaking site.. – Prescott Aug 10 '14 at 20:36
  • These don't appear to be CamelCase issues - do you have a same where CamelCase would actually apply? Do you have a sample of it working without the CamelCase - and then layering in camel case to show it breaks? – Prescott Aug 10 '14 at 20:37
  • ember.js components required field property json CamelCase {{input value=name}} otherwise not worked. – Russian_Dragon Aug 10 '14 at 21:29

1 Answers1

1

OData itself supports CamelCase, and this sample may help you:http://aspnet.codeplex.com/SourceControl/latest#Samples/WebApi/OData/v4/ODataCamelCaseSample/

Tan Jinfu
  • 3,327
  • 1
  • 19
  • 20
  • Little problem. using System.Web.OData.Builder and Microsoft.OData.Edm; i have using System.Web.Http.OData and System.Web.Http.OData.Builder; What's the difference libraries? – Russian_Dragon Aug 11 '14 at 11:08
  • System.Web.OData.dll is for OData v4, and System.Web.Http.OData.dll is for Odata v3. OData v4 is a standard of OASIS, but v3 is not. – Tan Jinfu Aug 11 '14 at 23:56