weixin_39980903
weixin_39980903
2021-01-08 01:38

Documentation would be more helpful if it mentioned what textReader is/does

In the documentation at http://joshclose.github.io/CsvHelper/ , you have the following two lines:

var csv = new CsvReader ( textReader ); var records = new CsvReader();

In terms of the documentation being a quickstart guide, it would be helpful if you included the line for the creation of textReader or described more obviously what it does.

该提问来源于开源项目:JoshClose/CsvHelper

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

5条回答

  • weixin_39768645 weixin_39768645 4月前

    TextReader or System.IO.TextReader is a type built into the .NET framework that all the readers inherit from. There are many ways that it could be created from. http://msdn.microsoft.com/en-us/library/system.io.textreader(v=vs.110).aspx

    Are you expecting the example to include something like this?

     C#
    var stream = File.OpenRead( myPath );
    var reader = new StreamReader( stream );
    var csv = new CsvReader( reader );
    

    I guess I'm expecting people that are using this library to have done some IO in .NET at some point before using it.

    点赞 评论 复制链接分享
  • weixin_39980903 weixin_39980903 4月前

    Hi,

    Yep something like that would be fine.

    I'm new to IO in .net (java programmer!), and anything that helps someone get started quicker is a good thing I think :-)

    On Sat, Nov 30, 2013 at 4:00 PM, Josh Close notifications.comwrote:

    TextReader or System.IO.TextReader is a type built into the .NET framework that all the readers inherit from. There are many ways that it could be created from. http://msdn.microsoft.com/en-us/library/system.io.textreader(v=vs.110).aspx

    Are you expecting the example to include something like this?

    var stream = File.OpenRead( myPath );var reader = new StreamReader( stream );var csv = new CsvReader( reader );

    I guess I'm expecting people that are using this library to have done some IO in .NET at some point before using it.

    — Reply to this email directly or view it on GitHubhttps://github.com/JoshClose/CsvHelper/issues/206#issuecomment-29546222 .

    点赞 评论 复制链接分享
  • weixin_39768645 weixin_39768645 4月前

    I don't think I'm going to add anything about that in for a couple of reasons. 1. It's basic .NET IO. 2. It's built into the framework. 3. There are many other things that would have to be documented also to be consistent. i.e. strings, arrays, etc 4. Visual Studio gives you the ability to find information about the type that it takes.

    I understand that you're just learning, but it's more of a language/framework feature, than anything specific to CsvHelper. If you didn't know what attributes were and a library used them, I don't think the library should have documentation on what attributes are and how they work.

    点赞 评论 复制链接分享
  • weixin_39588084 weixin_39588084 4月前

    Just throwing out I didn't know what textReader was either in the quick start. Had to google what it was and it landed me here. Makes the quick start less useful, nothing more frustrating than the easiest thing being difficult.

    点赞 评论 复制链接分享
  • weixin_39768645 weixin_39768645 4月前

    I'm probably going to have textReader link out to the docs. https://msdn.microsoft.com/en-us/library/system.io.textreader(v=vs.110).aspx

    点赞 评论 复制链接分享

相关推荐