4
votes
1answer
1k views

Customizing ASP Web API Json serialization by which Action is invoked

I am looking at converting an existing JSON api from a hacky MVC3 implementation to the latest MVC4 Web Api. The MVC3 implementation uses JSON.NET to do all the serialization which will make the ...
2
votes
1answer
61 views

Build Json String From 2 Different Dictionaries?

I am using json.net(newtonsoft) and I want to build a json request but I have 2 different dictionaries and not sure how to join them. Dictionary<string, HttpStatusCode> code = new ...
1
vote
1answer
177 views

WebApi action losing child collection from posted json

Suppose I post an object like this {"Dto" : { "DtoId" : 1, "DtoThing" : "Some value", "DtoChildStuff" : [{"CsId" : 1, "ChildProperty" : "SomeThing"}] ...
1
vote
1answer
272 views

How to return only some fields to json response in asp.net web api

I am working on asp.net mvc 4 web api. I am trying to return list of records as a json response. my table contains four fields field1,field2,field3 and field4 and i write the action like, public ...
0
votes
1answer
1k views

Serialization issue using JsonConvert.SerializeObject (properties missing on server)

I am getting pretty weird behaviour using JsonConvert.SerializeObject. I have a method looking like the following: public class ServiceController : ApiController { public object ...
0
votes
1answer
629 views

does not implement the WriteToStreamAsync method

I'm working on a MVC4 api using the release canidate. The error I get when I do a GET with a Content-Type: application/json I get this error: The media type formatter of type 'JsonNetFormatter' does ...
-1
votes
1answer
367 views

Handling newlines in data with Json.Net

Is there any way to handle newlines in JSON.NET. I have some data coming back with Carriage Return Line Feed in it and Json.Net is just leaving it raw in the return value. Is there a way to force ...
2
votes
0answers
91 views

How to control JSON.NET serialization of System.Data.Spatial.DbGeometry

I have a DB First Entity Framework 5 Data Access Layer that is mapped to a table containing a SQL geometry type field called CenterCoordinate. The resulting entity contains this: public ...
0
votes
0answers
47 views

Missing data when serializing object with JSON.Net

I am working on wrapping some existing code in an ASP.Net WebAPI controller. When serializing the object with JSON.Net the string returned is always empty (just empty {} ). The class that I am ...
0
votes
0answers
84 views

Circular reference while deserializing JSON.NET

I am building a website in ASP.NET MVC4 the application is linked with a webAPI. in both application and API I use a dbml LINQ to SQL file for the db connection and also serializing and deserializing. ...
0
votes
0answers
231 views

Web API with json as a parameter

Im working with asp.net MVC4, trying to implement some Web API with HTTP Post actions. Some of these actions require Json as a parameter, here is the signature of my method: [HTTPPost] public void ...
0
votes
0answers
227 views

How to get WebAPI XML serializer to use TypeConverter

In a ASP.NET Web API project, I've got a custom type with a TypeConverter that handles the to and from for string conversions, as described here: ...
0
votes
0answers
101 views

Serialize PointF C#

I'm using Web Api and when I try to return a List<PointF> I get the following error: {"Message":"An error has occurred.","ExceptionMessage":"The 'ObjectContent`1' type failed to serialize ...
0
votes
0answers
242 views

A way for WebAPI to serve XSD / DataSets to JSON?

I have a bunch of DataSets in XSD files in a legacy WebForms .NET 4 app. I added WebAPI to the solution but would like to serve those DataSets through WebAPI to get JSON results. Is there a built in ...
0
votes
0answers
264 views

ASP.NET Web Api - Unified JSON Api

I'm Writing an Api using the new ASP.Net 4.5 Web Api. My Api responses are very similar to fourSquare's Api Response Messages. My api should always response with messages like this one: { Meta: ...

1 2
15 30 50 per page