0
내가 정의 JSON 디시리얼라이저를 쓰고 있어요 내가이 편지를 쓰고있어이없는 JSON의 직렬화 :사용자 정의 키
public class MyObjectToJson : JavaScriptConverter
{
public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
{
MyObject TheObject = new MyObject;
TheObject.TheValue = serializer.ConvertToType<string>(dictionary["TheValue"]);
가 무엇 JSON 개체가 키 TheValue을 포함하지 않는하면 어떻게됩니까? 이 코드가 충돌하거나 TheObject.TheValue = ""를 계속 사용합니까?
좋습니다, 팁 주셔서 감사합니다. – frenchie