public object Deserialize(string contentType, Stream bodyStream, BindingContext context) { var deserializedObject = JsonSerializer.DeserializeFromStream(context.DestinationType, bodyStream); if (context.DestinationType.GetProperties(BindingFlags.Public | BindingFlags.Instance).Except(context.ValidModelProperties).Any()) { return(CreateObjectWithBlacklistExcluded(context, deserializedObject)); } return(deserializedObject); }
public override Task <object> ReadFromStreamAsync(Type type, Stream readStream, System.Net.Http.HttpContent content, IFormatterLogger formatterLogger) { var task = Task <object> .Factory.StartNew(() => JsonSerializer.DeserializeFromStream(type, readStream)); return(task); }