Is it possible?
I have a class like this:
public class ABC
{
[Key]
[ScriptIgnore]
public int Id { get; set; }
public string Name { get; set; }
public string AnotherField { get; set; }
[ScriptIgnore]
public virtual User User { get; set; }
}
But I would like to serialize like this { "name":"foo", "anotherField":"bar" }
instead of
{ "Name":"foo", "AnotherField":"bar" }
.
This is how I use:
return Request.CreateResponse(HttpStatusCode.OK, new JavaScriptSerializer().Serialize(obj));