I have a custom made class that use a long as ID. However, when I call my action using ajax, my ID is truncated and it loses the last 2 numbers because javascript loses prec
Depending on your case, you could potentially use getters and setters to masquerade the property as a string during JSON serialization.
public class Money
{
[JsonIgnore]
public decimal Money { get; set; }
[JsonProperty("money")]
public string MoneyAsString
{
get { return Money.ToString("0.00"); }
set { Money = decimal.Parse(value); }
}
}