-Added Serializable attribute to exceptions

-Fixed deserializing null values into DataTables
-Fixed error when deserializing readonly IEnumerable<T> array properties
-Fixed not including type name for byte[] values
This commit is contained in:
JamesNK
2011-05-07 02:16:26 +00:00
parent 1197d35cbb
commit 6b2238c39c
14 changed files with 185 additions and 7 deletions
@@ -4310,5 +4310,24 @@ keyword such as type of business.""
var withParameterisedConstructor = JsonConvert.DeserializeObject<DTOWithParameterisedConstructor>(json);
Assert.AreEqual(withoutParameterisedConstructor.B, withParameterisedConstructor.B);
}
public class EnumerableArrayPropertyClass
{
public IEnumerable<int> Numbers
{
get
{
return new[] { 1, 2, 3 }; //fails
//return new List<int>(new[] { 1, 2, 3 }); //works
}
}
}
[Test]
public void SkipPopulatingArrayPropertyClass()
{
string json = JsonConvert.SerializeObject(new EnumerableArrayPropertyClass());
JsonConvert.DeserializeObject<EnumerableArrayPropertyClass>(json);
}
}
}