Trying to figure out my serialization problem.
When I make a post request to my LoadById method I can't get to serialize my User class, obtaining a MyNamespace.User response instead of a JSON serialized User payload. Other methods work without any issues.
This is Web.Api ApiController..
public class UserServiceController : System.Web.Http.ApiController
{
[HttpPost]
public User LoadById(String id)
{
using (UserManager mng = new UserManager())
{
user = mng.LoadById(String id);
//string json = JsonConvert.SerializeObject(user, new JsonSerializerSettings { TraceWriter = traceWriter });
//Console.WriteLine(traceWriter);
}
return user;
}
}
This is the trace for the serialization:
2017-11-13T15:55:58.237 Info Started serializing MyNamespace.User. Path ''.
2017-11-13T15:55:58.237 Info Finished serializing MyNamespace.User. Path ''.
2017-11-13T15:55:58.237 Verbose Serialized JSON: "MyNamespace.User"
Json as string:
"MyNamespace.User"
User class:
The user class is quite complex, i only have access to the metadata that
doesn't show much.
how can I get more info to understand what's happening?