json数据反序列化成数据实体

JsonSerializerSettings setting = new JsonSerializerSettings()

        {

            MissingMemberHandling = MissingMemberHandling.Ignore,

            NullValueHandling = NullValueHandling.Ignore            

        };

StreamReader reader = new StreamReader(Request.InputStream);

string data = reader.ReadToEnd();

RequestEntity requestEntity = JsonConvert.DeserializeObject<RequestEntity>(data, setting);


你可能感兴趣的:(json数据反序列化成数据实体)