Tagged Questions
0
votes
2answers
61 views
Getting JSON Serialization Entity Framework Self Reference Loop error even after ProxyCreation false when using explicit Include
JSON Serialization (ASP.Net Web API) fails because of self-referencing loop (it’s a common problem, Reason: an entity being requested lazy loads child entities and every child has a back reference to ...
0
votes
1answer
40 views
Passing FUNC<> to my jsonResponseObj class in MVC4
I'm using a lot of Json.NET in my MVC4 site and I tried to simplify things a bit by using FUNC in my JsonNetResult class. I found that when I was writing a JsonNetResult controller action, I was ...
0
votes
1answer
59 views
Complex linq: Nested where statements JSON.net and linq
What I'm trying to accomplish is to select the dateTimeStart inside the ttSheduleDay. The JSON beneath is a node of one employee, the function receives three parameters an empUID, a date and a value ...
1
vote
2answers
178 views
JSON.Net in Api controllers w/ param containing Dictionary is always null
I've seen some tutorials out there that claim to work, but they are outdated or simply do not work.
How can I use JSON.Net to serialize and deserialize the data received to and sent from my API ...
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.
...
2
votes
2answers
139 views
JSON serializer creates an empty object on failed deserialization instead of null
In WebAPI, I've noticed an inconsistency that is messing with our validation practices. If you send a bad body/payload with a POST in xml, deserialization fails and you get an null pointer. If you ...
0
votes
0answers
150 views
circular references mvc 4 json.net deserialization
I have been developing a mvc api in C#. as a result from a query I get this string as return to my application:
...
2
votes
2answers
264 views
Json.Net IsoDateTimeConverter is not working
I have a web application made in asp.net mvc 4
in Global.asax, i added added IsoDateTimeConverter
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
...
2
votes
1answer
199 views
Url.Action becomes null when in JSON string
Bit of a noob with testing so please bear with me,
I have a controller that returns a JsonResult that contains a string calculated by Url.Action like this:
public ActionResult GetResult(SomeModel ...
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:
...
1
vote
1answer
1k views
NewtonSoft json Contract Resolver with MVC 4.0 Web Api not producing the output as expected
I am trying to create a conditional ContractResolver so that I can control the serialization differently depending on the web request/controller action.
For example in my User Controller I want to ...
1
vote
1answer
2k views
ASP.Net MVC4 - Setting the Default JSON Serializer
I'm having a hard time finding the answer to this:
I'm working on an existing application that has been partially converted over to MVC. Whenever a controller responds with a JSON ActionResult, the ...
3
votes
1answer
470 views
Using JSON.NET date format returned from a controller action
In my MVC4 project I have a controller action as follows:
public ActionResult GetJson()
{
var serialized = JsonConvert.SerializeObject(DateTime.Now);
return Json(DateTime.Now, ...
0
votes
0answers
133 views
Navigation property in reverse direction in Entity Framework
I created EF models using existing database as below link. a basic master-detail model, db names are Sheet and SheetDetail.
Why my super simple ASP.NET Web API (mvc4)+Entity Framework 5 doesn't ...