Newtonsoft.json: ๊ฐœ์ฒด๋ฅผ ์—ญ์ง๋ ฌํ™”ํ•  ๋•Œ ์˜ˆ๊ธฐ์น˜ ์•Š์€ ์ข…๋ฃŒ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ธธ ''

์— ๋งŒ๋“  2014๋…„ 12์›” 09์ผ  ยท  3์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: JamesNK/Newtonsoft.Json

์—ญ์ง๋ ฌํ™” ์ค‘์— ์ด ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.
๋‹ค์Œ์€ ์ง๋ ฌ ๋ณ€ํ™˜๊ธฐ์— ๋Œ€ํ•œ ์„ค์ •์ž…๋‹ˆ๋‹ค.

class CustomContractResolver : DefaultContractResolver
   {
      public new static readonly CustomContractResolver Instance = new CustomContractResolver();


      protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
      {
         JsonProperty property = base.CreateProperty(member, memberSerialization);
         if (property.DeclaringType == typeof(Vector3))
         {
            property.Ignored = true;
         }
         return property;
      }

      protected override JsonContract CreateContract(Type objectType)
      {
         if (objectType.GetInterfaces().Any(i => i == typeof(IDictionary) ||
            (i.IsGenericType &&
             i.GetGenericTypeDefinition() == typeof(IDictionary<,>))))
         {
            return base.CreateArrayContract(objectType);
         }
         return base.CreateContract(objectType);
      }
   }
        JsonSerializerjson = new JsonSerializer();
         json.Formatting = Formatting.Indented;
         json.ObjectCreationHandling = ObjectCreationHandling.Reuse;
         json.NullValueHandling = NullValueHandling.Ignore;
         json.StringEscapeHandling = StringEscapeHandling.Default;
         json.ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor;
         json.TypeNameHandling = TypeNameHandling.Objects;
         json.DefaultValueHandling = DefaultValueHandling.Ignore;
         json.PreserveReferencesHandling = PreserveReferencesHandling.All;
         json.ReferenceLoopHandling = ReferenceLoopHandling.Serialize;
         json.ContractResolver = new CustomContractResolver();
         serializer = new global::AdamantiumSerializer.AdamantiumSerializer();

์ง๋ ฌํ™”๋Š” ์ž˜ ๋˜๋Š”๋ฐ ์—ญ์ง๋ ฌํ™” ์ค‘์— ํ•ด๋‹น ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค. ๋‚ด๊ฐ€ ๋ญ”๊ฐ€๋ฅผ ๋†“์น˜๊ณ  ์žˆ์Šต๋‹ˆ๊นŒ?

ํ”Œ๋žซํผ: Windows 8.1, WinRT,
JSON ๋ฒ„์ „ 6.0.6.

๋ชจ๋“  3 ๋Œ“๊ธ€

์ฃ„์†กํ•ฉ๋‹ˆ๋‹ค. ์ œ ์ž˜๋ชป์ž…๋‹ˆ๋‹ค. ๋ฌธ์ œ๋Š” ์ด๋ฏธ ํ•ด๊ฒฐ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

์–ด๋–ป๊ฒŒ ํ•ด๊ฒฐํ•˜์…จ๋‚˜์š”?

์œ„์™€ ๊ฐ™์€ ์งˆ๋ฌธ์„...

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰