Adopt C# 12 syntax across library and tests for .NET 8#30
Merged
Conversation
Agent-Logs-Url: https://github.com/shibayan/CsvHelper.FastDynamic/sessions/f2f77655-d77f-465a-a07b-7ce4740bc334 Co-authored-by: shibayan <1356444+shibayan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/shibayan/CsvHelper.FastDynamic/sessions/f2f77655-d77f-465a-a07b-7ce4740bc334 Co-authored-by: shibayan <1356444+shibayan@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
shibayan
April 19, 2026 01:22
View session
There was a problem hiding this comment.
Pull request overview
Updates the solution to consistently use C# 12 features on .NET 8, modernizing several initialization patterns in the core library and test fixtures.
Changes:
- Pin the library project’s C# language version to 12.0.
- Modernize core library code using C# 12 collection expressions and target-typed
new. - Update test data fixtures to use collection expressions and dictionary indexer initializers.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| CsvHelper.FastDynamic/CsvRecordMetaObject.cs | Replace legacy array initializations with C# 12 collection expressions in DLR binding. |
| CsvHelper.FastDynamic/CsvReaderExtensions.cs | Use collection expression for empty list initialization in async record collection. |
| CsvHelper.FastDynamic/CsvHelper.FastDynamic.csproj | Pin C# language version to 12.0. |
| CsvHelper.FastDynamic/CsvHeader.cs | Use target-typed new for dictionary construction. |
| CsvHelper.FastDynamic.Tests/TestData.cs | Modernize test fixtures with collection expressions and indexer initializers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This updates the codebase to use the latest C# language features available with .NET 8. The change standardizes language configuration and applies targeted C# 12 syntax upgrades without altering runtime behavior.
Language version alignment
12.0(the latest C# level for .NET 8) instead of floatinglatest.Core library modernization
new(...)where the type is already known.Test data modernization
Example of the applied style update: