I´m trying to do something like this
public decimal Duration
{
get
{
return this.durationField;
}
set
{
this.meðallíftímiField = {if (typeof(value) == typeof(String)) return Convert.ToDecimal(value);}
}
Because i´m getting this object from Json object on the client, and sometimes it will be a value of type string, and sometimes of type decimal.
Could someone help me?
}
In your code snippet value always be of type decimal, because property type is decimal.
You can use this function to set duration