i am using MVC c# i have a object with
public class Person
{
public int TypeId { get; set; }
public string Code { get; set; }
}
i have a code that retruns JSON object for this object like this
return Json(personCodeStore.GetBusinessCodes());
But when I receive this on the client side i want to be able to rename the field name from
TypeId to value
Code to text
I do not want to use DataContractSerializer like MVC3 JSON Serialization: How to control the property names? because i am using EF 5.x and every time i update the model and .tt file runs it overwrites my changes and also it uses this modified property on all my views which i don't want.
So is there a way i can rename this when i serialize it or once i get on client side using jquery?