I built a working Minimal API with EF Core in 3 files.
You can do the same in 10 minutes.
No solution file.
No csproj.
No project setup.
Just three .cs files and the dotnet CLI.
This is file-based apps in .NET 11 Preview 3.
And it's a complete shift in how you can build internal tools and prototypes.
𝗧𝗵𝗲 𝟯-𝗳𝗶𝗹𝗲 𝘀𝘁𝗿𝘂𝗰𝘁𝘂𝗿𝗲
1. Order.cs
↳ Plain POCO with Id, OrderNumber, CustomerName, Amount, CreatedAt
2. OrdersDbContext.cs
↳ The EF Core DbContext with inline Fluent API mappings
3. main.cs
↳ DI setup, Minimal API endpoints, app[.]Run()
That's it: 3 files in a folder.
𝗧𝗵𝗲 𝗺𝗮𝗴𝗶𝗰 𝗶𝘀 𝗶𝗻 𝟰 𝗱𝗶𝗿𝗲𝗰𝘁𝗶𝘃𝗲𝘀 𝗮𝘁 𝘁𝗵𝗲 𝘁𝗼𝗽 𝗼𝗳 𝗺𝗮𝗶𝗻.𝗰𝘀
#:sdk Microsoft[.]NET[.]Sdk[.]Web
↳ Unlocks WebApplication and ASP .NET Core types
#:package Microsoft.EntityFrameworkCore.Sqlite@10.0.0
↳ Pulls in the SQLite provider on first run
#:include Order.cs
↳ Brings the entity into the compilation
#:include OrdersDbContext.cs
↳ Brings the DbContext into the compilation
Four lines replace an entire csproj and sln.
Below the directives, it's standard ASP .NET Core code.
I can run it with a single command:
𝚍𝚘𝚝𝚗𝚎𝚝 𝚛𝚞𝚗 𝚖𝚊𝚒𝚗.𝚌𝚜
First run restores EF Core.
Every run after that is fast.
You now have a real web API with a real database.
✅ When file-based apps win
→ Internal tools without ceremony
→ Prototypes you can share as a single folder
→ Demos that work in a few minutes
→ Replacing Python scripts where you want strong typing
→ Onboarding new devs without csproj confusion
❌ When you should NOT use them
→ Multi-project solutions with shared libraries
→ Apps with custom MSBuild logic
→ NuGet package authoring
→ Production apps with full CI/CD and test projects
And when your script outgrows itself, one command converts it:
𝚍𝚘𝚝𝚗𝚎𝚝 𝚙𝚛𝚘𝚓𝚎𝚌𝚝 𝚌𝚘𝚗𝚟𝚎𝚛𝚝 𝚖𝚊𝚒𝚗.𝚌𝚜
You get a full csproj with all directives translated.
I've covered the complete workflow with all code samples in this week's newsletter issue.
📌 Read the full guide:
↳
antondevtips.com/blog/file-b…
Inside you'll find:
✅ Full HTTP health-check tool walkthrough
✅ Complete Minimal API with all 4 endpoints
✅ Exact EF Core mappings, DI setup, and migration step
✅ The checklist for when to convert to a full project
Where would you try file-based apps first - scripts, prototypes, or internal tools?
——
𝗣.𝗦.: 𝗔𝘇𝘂𝗿𝗲 𝗖𝗼𝗽𝗶𝗹𝗼𝘁 𝗠𝗶𝗴𝗿𝗮𝘁𝗶𝗼𝗻 𝗔𝗴𝗲𝗻𝘁 𝗶𝘀 𝗛𝗲𝗿𝗲
Microsoft's Azure Copilot Migration Agent can turn complex migration data into clear answers. With natural language prompts, you can evaluate readiness, risk, ROI, and automate landing zone requirements to make confident decisions for you and your team.
Download the free playbook to get started:
fandf.co/4tZmWAE
——
♻️ Repost to help other .NET developers build faster
➕ Follow me (
@AntonMartyniuk ) to improve your .NET and Architecture Skills