Merged
Conversation
added 13 commits
January 14, 2026 11:20
- Add ReadOnlyDbSetExtensions with CreateAsync methods for test data creation - Add DbSetExtensions with AsReadOnly method for ReadOnlyDbSet conversion - Implement comprehensive unit test suite with 9 passing tests - Add TestDbContext with proper ReadOnlyDbSet setup - Remove cross-repository dependencies for standalone testing - Fix extension method syntax and reflection-based inner DbSet access - Add production safety warnings and environment validation Tests: 9 passed, 0 failed
- Add missing Release configuration for test project in solution file - Fix broken extension method syntax in ReadOnlyDbSetExtensions.cs - Convert malformed nested extension structure to proper extension methods
- Removed explicit 'using System;' since ImplicitUsings is enabled - Clean and rebuild to resolve duplicate assembly attribute errors - All tests still pass in Release configuration
- Modified project file to use project references when CI=true is set - This ensures GitHub Actions can find Bounteous.Data and Bounteous.Core types - Package references still used for local Release builds (CI != true) - Verified build and tests pass with CI=true environment variable
- Added back Bounteous.Data and Bounteous.Core project references to Debug config - ReadOnlyDbSetExtensions.cs requires these types in both Debug and Release - Both configurations now build successfully - All tests pass in Release configuration
…gurations - Removed local project references, now using NuGet packages for both Debug and Release - Both configurations use Bounteous.Data v0.0.26 and Bounteous.Core v0.0.18 - Ensures consistent dependency management across all environments - All builds and tests pass successfully
- Added ProductionUsageAttribute for marking production-restricted APIs - Created ProductionDetector utility with smart context detection: * Allows usage in Debug builds * Allows usage in data migration contexts (even Release) * Allows usage in test contexts (xUnit, NUnit, MSTest) * Blocks usage in production Release builds - Enhanced ProductionWarningMarker with ValidateContext() method - Updated ReadOnlyDbSetExtensions to use new production detection - Added ProductionDetectorTests to verify functionality - All 7 tests pass including new production detection tests
- Added 'using System;' to ProductionWarningMarker.cs - Added explicit imports to ReadOnlyDbSetExtensions.cs: * System * System.Collections.Generic * System.Reflection * System.Threading.Tasks - Clean and rebuild resolved duplicate assembly attribute issues - All 7 tests pass and lint errors are resolved
## Multi-Strategy Detection System: - **Strategy 1**: Explicit production environment variables (ASPNETCORE_ENVIRONMENT, DOTNET_ENVIRONMENT, etc.) - **Strategy 2**: Production hosting environments (Azure, AWS, GCP, Kubernetes, Heroku, Vercel, etc.) - **Strategy 3**: Production assembly pattern detection (.web, .api, .service, etc.) - **Strategy 4**: Development environment detection (Development, Local, Dev) ## Enhanced Capabilities: - **Performance**: Lazy caching for production/allowed context detection - **Comprehensive Test Detection**: xUnit, NUnit, MSTest, Moq, NSubstitute, etc. - **Enhanced Migration Detection**: EF tools, command line args, call stack analysis - **Detailed Error Messages**: Shows detection state in exceptions - **Cloud Hosting Support**: Detects Azure Functions, AWS Lambda, Google Cloud, etc. ## Key Improvements: - Fixed circular dependency in detection logic - Added nullable reference handling - Comprehensive test coverage (23 tests pass) - Backward compatibility maintained ## Detection Examples: ✅ **Allowed**: Debug builds, EF migrations, xUnit/NUnit tests, Development env ❌ **Blocked**: Release builds in production hosting, production assemblies, Production env All tests pass in Release configuration while maintaining production safety.
- Re-enabled <ImplicitUsings>enable</ImplicitUsings> in project file - Disabling implicit usings caused IDE linting to not recognize System types - Build and tests continue to work correctly with implicit usings enabled - All 23 tests pass in Release configuration - Clean and rebuild resolved duplicate assembly attribute issues
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
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.
No description provided.