Beispiel #1
0
        private static JsonSerializerSettings GetDeserializerSettings()
        {
            var jsonResolver = new IgnorableSerializerContractResolver();


            foreach (var ignored in Options.Ignored)
            {
                jsonResolver.Ignore(ignored.OwningType, ignored.Name);
            }

            // ignore single property
            return(new JsonSerializerSettings()
            {
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
                ContractResolver = jsonResolver,
                TypeNameHandling = TypeNameHandling.Objects
            });
        }
Beispiel #2
0
        private static JsonSerializerSettings GetSerializerSettings()
        {
            var jsonResolver = new IgnorableSerializerContractResolver();


            foreach (var ignored in Options.Ignored)
            {
                jsonResolver.Ignore(ignored.OwningType, ignored.Name);
            }

            // ignore single property
            return(new JsonSerializerSettings()
            {
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
                ContractResolver = jsonResolver,
                TypeNameHandling = TypeNameHandling.All,

                MissingMemberHandling = MissingMemberHandling.Error,
                TypeNameAssemblyFormat = System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Simple
            });
        }