Skip to content

.NET 8/.NET 9 support and testing #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Conversation

snickler
Copy link
Owner

@snickler snickler commented May 8, 2025

No description provided.

snickler added 8 commits May 7, 2025 22:09
…am and MapToList functionalities, including various scenarios for parameter handling and data mapping.
…nfigurations for x64 and x86 platforms. Update EFExtensionsTests to improve mocking and parameter handling, ensuring robust unit tests for LoadStoredProc and WithSqlParam functionalities.
…bParameter, and DbParameterCollection to facilitate unit testing in EFCoreFluent. These classes provide basic functionality and state tracking for testing database interactions.
…FakeDb classes. Update WithSqlParam logic to improve null handling and streamline test assertions. Remove unnecessary Moq setups and replace with FakeDb implementations for better test isolation and clarity.
…List and MapToList methods. Update project file to specify MIT license expression instead of URL, improving clarity and compliance.
…ET versions. Introduce a matrix strategy for builds on Ubuntu, Windows, and Windows 11 arm64 with .NET versions 8.0.x and 9.0.x. Enhance steps for setup and testing, and update artifact upload conditions.
@snickler snickler requested a review from Copilot May 8, 2025 04:01
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support and testing for .NET 8 and .NET 9 by updating project target frameworks, test infrastructure, and build workflows. Key changes include:

  • Updating test and source csproj files to target net8.0 and net9.0 along with improved licensing and AOT settings.
  • Adding/updating various fake implementations (DbConnection, DbCommand, DbDataReader, etc.) to support testing scenarios.
  • Enhancing the GitHub Actions workflow with a build matrix across different OS environments and .NET versions.

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
EFCoreFluent/tests/Snickler.EFCore.Tests.csproj Updated target frameworks and test-specific settings
EFCoreFluent/tests/Snickler.EFCore.Tests/Fakes/*.cs Added fake implementations for Db classes
EFCoreFluent/src/EFCoreFluent/Snickler.EFCore.csproj Updated target frameworks, license info, and AOT flags
EFCoreFluent/src/EFCoreFluent/EFExtensions.cs Updated schema lookup and mapping logic with new attributes
EFCoreFluent/EFCoreFluent.sln Updated solution file with new project configurations
.github/workflows/dotnet.yml Improved workflow matrix for OS and .NET versions

snickler added 6 commits May 8, 2025 00:02
… to 'main' for push and pull request triggers.
…ReadToValueTupleList methods. Update README to reflect new capabilities and AOT compatibility. Modify solution and project files for ARM64 support and update GitHub Actions workflow for Windows builds. Add unit tests for new functionalities and improve test coverage.
…generator for reflection-free mapping in ReadToList and ReadToValueTupleList methods. Update README to clarify AOT compatibility and source generation process. Add test POCOs for generator access and modify project files to include source generator project and necessary references. Improve unit tests to validate new functionalities and ensure robust error handling.
…tion.ThrowIfNull. Streamline reader usage in ExecuteReader methods for improved readability. Update SprocResultsGenerator to enhance type checking with pattern matching. Remove unnecessary diagnostic reporting for generator execution.
…s (Ubuntu and macOS) for .NET builds. Refactor build and test steps for clarity, and introduce a new job for packing and publishing NuGet packages. Modify project file to specify runtime identifiers and disable automatic package generation on build.
@snickler snickler requested a review from Copilot May 9, 2025 16:13
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds .NET 8/.NET 9 support, enhances AOT compatibility through a source generator, and updates testing and CI configurations.

  • Updates project and test csproj files to target net8.0 and net9.0 along with new runtime identifiers.
  • Introduces source generator-based dispatch in EFExtensions for reflection‐free mapping and improves test fakes.
  • Revises GitHub Actions workflows to test and pack across multiple platforms and OS configurations.

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
README.md Expanded documentation to highlight new features and AOT compatibility.
EFCoreFluent/tests/Snickler.EFCore.Tests/*.cs Added and updated fake database implementations and test support files.
EFCoreFluent/src/Snickler.EFCore.csproj Updated target frameworks, package metadata, and added AOT compatibility properties.
EFCoreFluent/src/EFCoreFluent/EFExtensions.cs Modified extension methods to use source generator dispatch and improved null handling.
.github/workflows/dotnet.yml Updated CI to include broader OS matrix and .NET 9 settings.
Comments suppressed due to low confidence (1)

EFCoreFluent/src/Snickler.EFCore.csproj:6

  • [nitpick] Include a comment explaining why GeneratePackageOnBuild is now set to false so future maintainers understand the revised build process.
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>

Comment on lines +77 to +79
_parameters[index] = value;
else
Add(value); // Or throw? Add seems more common.
Copy link
Preview

Copilot AI May 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider reviewing the behavior in SetParameter(string, DbParameter): if a parameter is not found, decide whether to consistently throw an exception or add the parameter. Document the intended behavior for future maintainers.

Suggested change
_parameters[index] = value;
else
Add(value); // Or throw? Add seems more common.
{
_parameters[index] = value;
}
else
{
throw new ArgumentException($"Parameter with name '{parameterName}' not found.", nameof(parameterName));
}

Copilot uses AI. Check for mistakes.


pack_and_publish:
needs: build # Ensure build and tests pass before packing
runs-on: windows-11-arm # Packing can be done on a single OS
Copy link
Preview

Copilot AI May 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider adding a comment to explain the choice of windows-11-arm as the runner for packing to clarify the reasoning behind this specific OS configuration.

Suggested change
runs-on: windows-11-arm # Packing can be done on a single OS
runs-on: windows-11-arm # Chosen for compatibility with ARM64 architecture and to ensure the package is built and tested on a platform that matches one of the target runtime environments (e.g., win-arm64).

Copilot uses AI. Check for mistakes.

… to use MSBuild.Sdk.Extras. Enhance runtime identifier support and adjust platform settings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant