public UploadMultipartStreamProvider( IUploadWriterProvider writerProvider, UploadStatusManager status, Type modelType) { _writerProvider = writerProvider; _status = status; _modelType = modelType; }
public override async Task <object> ReadFromStreamAsync( Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger) { var statusManager = new UploadStatusManager( GetProgressHeaderValue(content.Headers), content.Headers.ContentLength.GetValueOrDefault()); var filePartStreamProvider = _getFilePartStreamProvider(type, content); var streamProvider = new UploadMultipartStreamProvider( filePartStreamProvider, statusManager, type); var contents = await content.ReadAsMultipartAsync( streamProvider); return(contents.GetModel(type)); }