If generic class includes empty initialized string data member(string unit),
Exception is thrown in JavaScript run time.
if unit is initialized non empty value, it works fine.
Code: Select all
[DataContract]
public class CompositeType<T> where T : struct
{
T val;
[DataMember]
public T Value {
get { return val; }
set { val = value; }
}
string unit = string.Empty;
[DataMember]
public string Unit { get { return unit; } set { unit = value; } }
}