Migrate from System.Data.SqlClient to Microsoft.Data.SqlClient#1
Open
Isuru-F wants to merge 1 commit into
Open
Migrate from System.Data.SqlClient to Microsoft.Data.SqlClient#1Isuru-F wants to merge 1 commit into
Isuru-F wants to merge 1 commit into
Conversation
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.
🔄 Migrate from System.Data.SqlClient to Microsoft.Data.SqlClient
📋 Overview
This PR migrates the legacy e-commerce API from the deprecated
System.Data.SqlClientpackage to the modernMicrosoft.Data.SqlClientpackage, addressing critical security vulnerabilities and following Microsoft's recommended migration path.🔍 Problem Statement
The project was using
System.Data.SqlClientversion 4.8.5, which:✅ Solution
Migrated to
Microsoft.Data.SqlClientversion 5.1.6, which is:🔧 Changes Made
1. Package Reference Update
File:
LegacyECommerceApi.csproj2. Using Statement Updates
Updated namespace imports in all repository classes:
Files Modified:
Repositories/CustomerRepository.csRepositories/OrderRepository.csRepositories/ProductRepository.cs3. Documentation Added
progress.mdwith detailed migration tracking and status🧪 Testing & Validation
✅ Before Migration
✅ After Migration
Build Results
Build succeeded. 3 Warning(s) # Only .NET 7 EOL warnings, no security warnings 0 Error(s)🔄 Migration Approach
Why This Approach?
API Compatibility
🎯 Impact Assessment
✅ Positive Impact
🚫 No Breaking Changes
📊 Files Changed
LegacyECommerceApi.csprojRepositories/CustomerRepository.csRepositories/OrderRepository.csRepositories/ProductRepository.csprogress.mdTotal: 4 files modified, 1 file added
🚀 Next Steps (Future PRs)
While this migration is complete, consider these future improvements:
Encrypt=true)✅ Ready to Merge