public virtual HttpContent GetResult(HttpRequestMessage request, Config.Config config) { if (IsFaulted) { throw new Exception("Обработка запроса завершилась ошибкой"); } HttpContent content = null; if (!String.IsNullOrEmpty(MultipartContent)) { var multipart = new MultipartContent(); multipart.Add(new StreamContent(File.OpenRead(OutputFile(config)))); foreach (var file in JsonConvert.DeserializeObject <string[]>(MultipartContent)) { multipart.Add(new StreamContent(File.OpenRead(FileHelper.MakeRooted(file)))); } content = multipart; } else { var fileStream = File.OpenRead(OutputFile(config)); var fronRange = request.Headers.Range?.Ranges.FirstOrDefault()?.From; if (fronRange != null) { fileStream.Position = fronRange.Value; } content = new StreamContent(fileStream); } if (UpdateType.Match("OrdersController")) { content.Headers.Add("Content-Type", "application/json"); } return(content); }