Skip to content

NET-10: Set up .NET Core 6 project scaffolding#18

Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/net-10-1776915784-net6-scaffolding
Open

NET-10: Set up .NET Core 6 project scaffolding#18
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/net-10-1776915784-net6-scaffolding

Conversation

@devin-ai-integration
Copy link
Copy Markdown

Summary

Establishes the foundational .NET Core 6 project structure for the migration tracked in NET-10. The legacy ASP.NET MVC5 / EF6 projects at the repo root are left untouched; the new .NET Core 6 tree lives alongside them so subsequent phases (starting with HomeController migration) can move code over incrementally.

New top-level layout:

SampleWebApp.Core.sln
src/
  DataLayer/        net6.0 classlib (EF Core 6 + SqlServer provider + Tools)
  BizLayer/         net6.0 classlib (references DataLayer)
  ServiceLayer/     net6.0 classlib (references DataLayer)
  SampleWebApp/     ASP.NET Core MVC (net6.0), references all three layers
tests/
  Tests/            xUnit net6.0, references all src projects

Key pieces wired up:

  • DataLayer/DataClasses/SampleWebAppDbContext.cs — empty EF Core DbContext (Blogs/Posts/Tags DbSets are deliberately deferred to later phases) with a ConnectionStringName = "SampleWebAppDb" constant that matches the legacy Web.config name.
  • Per-layer DI extension methods (AddDataLayer, AddServiceLayer, AddBizLayer) registered in src/SampleWebApp/Program.cs. AddDataLayer calls UseSqlServer with the SampleWebAppDb connection string and throws if it's missing.
  • appsettings.json + appsettings.Development.json / appsettings.Staging.json / appsettings.Production.json with environment-appropriate log levels. Dev/base include the (localdb)\mssqllocaldb connection string (matches the legacy default).
  • MVC scaffolding (HomeController, Views, wwwroot with bootstrap/jquery, Program.cs) generated by dotnet new mvc — included so the solution builds and a Home page serves out-of-the-box.

dotnet build SampleWebApp.Core.sln succeeds locally with 0 warnings / 0 errors. dotnet test runs but reports "No test is available" (the xUnit project is intentionally empty — actual tests come with later phases).

Review & Testing Checklist for Human

  • Confirm the src/ + tests/ folder layout alongside the legacy projects is the intended structure (vs. e.g. replacing the legacy tree or using a different naming scheme like .Core suffixes).
  • Confirm the scope: SampleWebAppDbContext has no DbSets and AddServiceLayer / AddBizLayer are empty no-op registrations. This is intentional for foundation-only, but verify it matches the team's expectation for NET-10 vs. what belongs in later tickets.
  • Connection string uses (localdb)\mssqllocaldb which only works on Windows. If devs run on Linux/macOS or CI, a different default (or user-secrets / env override) may be needed.
  • The new xUnit test project contains zero tests — if CI asserts tests must exist or code coverage thresholds apply, this will need a placeholder test or CI config update.
  • Run dotnet build SampleWebApp.Core.sln and dotnet run --project src/SampleWebApp on a Windows machine with LocalDB to confirm the app starts and the Home page serves.

Notes

  • The legacy SampleWebApp.sln and all existing .csproj / packages.config files are unchanged.
  • The new DataLayer.csproj deliberately does not define InternalsVisibleTo("Tests") like the legacy project did; that can be re-added when real entities start moving over.
  • A large portion of the diff is static assets under src/SampleWebApp/wwwroot/lib/ (bootstrap, jquery, jquery-validation) generated by dotnet new mvc — not hand-written.

Link to Devin session: https://app.devin.ai/sessions/c31603dfc46e406fa99067729d9a7851

- Add SampleWebApp.Core.sln with net6.0 projects:
  - src/DataLayer (classlib, EF Core 6 + SqlServer provider)
  - src/BizLayer (classlib)
  - src/ServiceLayer (classlib)
  - src/SampleWebApp (ASP.NET Core MVC)
  - tests/Tests (xUnit)
- Add SampleWebAppDbContext (EF Core) and per-layer DI extension methods
  (AddDataLayer / AddServiceLayer / AddBizLayer) wired up in Program.cs
- Add appsettings.json plus Development/Staging/Production overrides and
  the SampleWebAppDb connection string
- Legacy EF6/MVC5 projects at the repo root are left untouched; the new
  .NET Core 6 tree lives alongside them for incremental migration

Co-Authored-By: unknown <>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

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.

0 participants