I have created my custom CSV media type formatter following these two tutorials:

http://www.asp.net/web-api/overview/formats-and-model-binding/media-formatters

http://www.tugberkugurlu.com/archive/creating-custom-csvmediatypeformatter-in-asp-net-web-api-for-comma-separated-values-csv-format

And it work fine, if not one problem:

I am not getting the hole data on csv file.

enter image description here

and on my csv i am getting 172 lines:

enter image description here

What could be causing this problem?

没有正确的解决方案

其他提示

For everyone who find the "data loss" problem when using StreamWriter: This is the fix i have found:

 myStreamWriter.AutoFlush = true;
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top