From 2a1cd4fda8a4a8e649910d16b4dfa1ce7ae63543 Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Fri, 12 May 2023 09:24:40 +0800 Subject: *misc --- .../CsvHelper.Website/input/migration/v28/index.md | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 ThirdParty/CsvHelper-master/src/CsvHelper.Website/input/migration/v28/index.md (limited to 'ThirdParty/CsvHelper-master/src/CsvHelper.Website/input/migration/v28/index.md') diff --git a/ThirdParty/CsvHelper-master/src/CsvHelper.Website/input/migration/v28/index.md b/ThirdParty/CsvHelper-master/src/CsvHelper.Website/input/migration/v28/index.md new file mode 100644 index 0000000..743dd9c --- /dev/null +++ b/ThirdParty/CsvHelper-master/src/CsvHelper.Website/input/migration/v28/index.md @@ -0,0 +1,38 @@ +# Migrating from version 27 to 28 + +## ShouldSkipRecordArgs + +- `string[] ShouldSkipRecordArgs.Record` changed to `IReaderRow ShouldSkipRecordArgs.Row`. + +```cs +// 27 +var config = new CsvConfiguration(CultureInfo.InvariantCulture) +{ + ShouldSkipRecord = args => args.Record.Length < 10; +}; + +// 28 + +var config = new CsvConfiguration(CultureInfo.InvariantCulture) +{ + ShouldSkipRecord = args => args.Row.Parser.Record.Length < 10; +}; +``` + +## ConfigurationFunctions.ShouldSkipRecord + +- Removed `ConfigurationFunctions.ShouldSkipRecord`. + +`null` can be used in place of this now, and is the default. + +```cs +var config = new CsvConfiguration(CultureInfo.InvariantCulture) +{ + ShouldSkipRecord = null +}; +``` + + +## IParserConfiguration.Validate + +Implement the `Validate` method. -- cgit v1.1-26-g67d0