Phase 2: Data Layer Migration from Entity Framework 6.1.3 to Entity Framework Core#8
Open
devin-ai-integration[bot] wants to merge 1 commit intodevin/1765786247-phase1-dotnet-core-infrastructurefrom
Conversation
…ramework Core - Update DataLayer.Core to target net8.0 with EF Core 8.0 packages - Migrate entity classes (Blog, Post, Tag) with validation logic preserved - Create SampleWebAppDbCore DbContext with change tracking and model configuration - Add TrackUpdate helper class for LastUpdated tracking - Create DataLayerCoreInitialise for database initialization - Add LoadDbDataFromXml helper for seeding data from XML files - Copy XML data files (BlogsContentSimple.xml, BlogsContextMedium.xml) - Update ServiceLayer.Core to target net8.0 for compatibility - Add comprehensive unit tests for DataLayer.Core (15 tests) - Configure Tag Slug uniqueness constraint in OnModelCreating - Preserve all entity relationships (Blog-Post, Post-Tag many-to-many) Co-Authored-By: Abhay Aggarwal <abhay.aggarwal@codeium.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Phase 2: Data Layer Migration from Entity Framework 6.1.3 to Entity Framework Core
Summary
This PR implements Phase 2 of the .NET Framework to .NET Core migration, migrating the DataLayer from Entity Framework 6.1.3 to Entity Framework Core 8.0. Building on the Phase 1 infrastructure, this adds the actual EF Core implementation with migrated entity classes, DbContext, and database initialization logic.
Key changes:
net8.0(required for EF Core 8.0)SampleWebAppDbCoreDbContext with change tracking viaTrackUpdatepatternOnModelCreatingDataLayerCoreInitialisefor database initialization andLoadDbDataFromXmlfor data seedingBuild status: Succeeded with 25 nullable reference type warnings (CS8618) - these are expected when migrating legacy code to nullable-enabled projects.
Review & Testing Checklist for Human
requiredmodifier or nullable annotationsRecommended test plan:
dotnet build SampleMvcWebApp.Core.sln --configuration Release- should succeed with warningsdotnet test SampleMvcWebApp.Core.sln- all 15 tests should passNotes
ValidateEntityoverride for Tag Slug uniqueness is now handled viaHasIndex().IsUnique()inOnModelCreatingLink to Devin run: https://app.devin.ai/sessions/88606214e3b14e1681a1d720b725fa31
Requested by: Abhay Aggarwal (abhay.aggarwal@cognition.ai) / @abhay-codeium