Expert · Interviews, portfolio and careers · topic 41 of 43 · 40 min
Your portfolio project: a tested Web API with EF Core
Explanation
Why one strong project?
Recruiters see hundreds of CVs that list "C#, .NET, SQL". A link to a clean GitHub repository with a working API, tests and a good README proves you can actually build. In interviews it also gives you something concrete to talk about, which is easier and more convincing than abstract questions.
Pick a problem you understand
- Clinic appointments: doctors, time slots, bookings, no double-booking (409 Conflict).
- Library: books, members, issue and return, late fees.
- Hostel mess: students, monthly bills, payments, dues report.
- Small shop inventory: products, stock, sales, low-stock report.
Choose one with a few real rules (fees, limits, conflicts). Rules give you something meaningful to test and talk about.
Feature checklist
| Area | What to include |
|---|---|
| API | 4 to 6 resources with GET/POST/PUT/DELETE, route groups, input DTOs |
| Validation and errors | 400 with clear messages, 404, 409 for conflicts, a global exception handler |
| Data | EF Core with migrations, relationships, Include or projections, AsNoTracking for reads |
| Design | Business rules in services behind interfaces, registered with DI |
| Config | Connection string in configuration; secrets in user-secrets; nothing secret in Git |
| Tests | xUnit tests for the business rules (with fakes), ideally a few integration tests |
| Docs | README with what it does, how to run it, example requests, and design decisions |
| Extras (optional) | Authentication with JWT, pagination, logging, Docker, a CI workflow that runs dotnet test |
A sensible structure
ClinicBooking/
ClinicBooking.sln
src/
ClinicBooking.Api/ Program.cs, endpoints, DTOs
ClinicBooking.Core/ entities, rules (BookingService), interfaces
ClinicBooking.Data/ ClinicDb (DbContext), migrations
tests/
ClinicBooking.Tests/ rule tests with fakes
README.md
.gitignoreA rule worth testing
public class BookingService(IAppointmentStore store, TimeProvider time)
{
public async Task<BookingResult> BookAsync(int doctorId, DateTime slot, string patient)
{
if (slot <= time.GetLocalNow().DateTime)
return BookingResult.Fail("Slot is in the past");
if (slot.Minute % 15 != 0)
return BookingResult.Fail("Slots start every 15 minutes");
if (await store.IsTakenAsync(doctorId, slot))
return BookingResult.Conflict("Slot already booked");
await store.AddAsync(doctorId, slot, patient);
return BookingResult.Ok();
}
}Plan it in weeks
- Week 1: design the entities and endpoints on paper; create the solution; build the API with an in-memory list.
- Week 2: add EF Core with SQLite, migrations, relationships and validation.
- Week 3: move rules into services, write unit tests, add a global error handler.
- Week 4: polish: README, example .http requests, clean commits; optional JWT auth or Docker.
The README that gets read
- One paragraph: what problem it solves and for whom.
- Tech used: .NET version, ASP.NET Core, EF Core, xUnit.
- How to run: clone, dotnet ef database update, dotnet run, and where to send requests.
- Example requests and responses.
- Design notes: why you chose the structure, what you would add next.
Common mistakes and fixes
- Copying a tutorial project as-is: interviewers recognise them. Change the domain and add your own rules.
- One giant commit at the end: commit in small steps with clear messages. It shows how you work.
- No tests: even ten good unit tests set you apart from most fresher projects.
- Overbuilding (microservices, five design patterns) before the basics work: finish a simple version first.
Need help?
Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.
Try:
Watch the lesson
Your portfolio project: a tested Web API with EF Core · 1/7
In this lesson you will plan the one project that proves your .NET skills.
Prefer a video by a teacher? Find free videos on “ASP.NET Core web API project for portfolio EF Core xUnit beginner” on YouTube ↗
In real life: From a final-year project to a job offer
A B.Tech student in Nagpur turned her college "hostel complaint system" into a clean ASP.NET Core Web API with EF Core, a tested rule that escalates complaints older than 48 hours, and a README with example requests. In interviews she was asked mostly about her own design choices, which she could answer in depth.
public static class Escalation
{
public static bool ShouldEscalate(DateTime raisedAt, DateTime now, bool resolved) =>
!resolved && now - raisedAt > TimeSpan.FromHours(48);
}
public class EscalationTests // in the xUnit test project
{
[Theory]
[InlineData(49, false, true)]
[InlineData(47, false, false)]
[InlineData(72, true, false)]
public void ShouldEscalate_After48Hours(int hoursAgo, bool resolved, bool expected)
{
var now = new DateTime(2026, 7, 1, 12, 0, 0);
Assert.Equal(expected, Escalation.ShouldEscalate(now.AddHours(-hoursAgo), now, resolved));
}
}Practice (0/3 done)
Which project is most convincing to a .NET recruiter?
Where should the database password for your project live during development?
Write a one-page plan for your portfolio project: the domain and users, 4 to 6 entities with their relationships, the endpoint list with methods and status codes, at least three business rules you will unit test, and a four-week schedule.
Quick quiz
Read more (free)
Related help
Before this, learn
This topic builds on these. If something here feels new, open them first.
Related topics
- Career paths with C# and .NET in IndiaInterviews, portfolio and careers · same module
- A 30-day revision plan for the whole courseInterviews, portfolio and careers · same module
- Your portfolio project: a production-style Go APIGo Programming (backend and cloud) · Careers and interviews
- Your portfolio projectFrontend Web Development · Build, deploy and get hired
- Your portfolio and GitHubFull-Stack Development · Capstone, portfolio and getting work
- Portfolio, projects and interviewsData Science, Machine Learning and AI · Ethics, privacy and careers
Questions people ask about this
Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.
Why put business rules in a service behind interfaces?
Answer: So the rules can be unit tested with fakes and reused
Testable, reusable rules are a sign of good design.
Which should NOT be committed to your project repository?
Answer: bin/ and obj/ folders and secrets
Build output and secrets stay out of Git.
What is the best first step for a portfolio project?
Answer: Get a simple version working end to end, then improve it
Finish a simple, working version first.
Where should database passwords for your project live?Related
Answer: In environment variables, never committed
Commit an example config without real secrets, if anything.
Which set of things should every project README have?Related
Answer: A title, live link, screenshot, tech used and how to run it
These let a busy reader understand, see and try the project in a minute.
How do you make a GitHub profile README?Related
Answer: Create a public repository with exactly the same name as your username and add README.md
GitHub shows the README.md of the repository named after your username at the top of your profile.
Since which version does a new ASP.NET Core app start from Program.cs without Startup.cs?Related
Pass the quiz (60% or more) or mark this topic as done when you are ready.
Your progress is saved on this device only.
Next steps
- 2 more topics in “Interviews, portfolio and careers” before its exam: Career paths with C# and .NET in India, A 30-day revision plan for the whole course.
- Module 10 exam: Interviews, portfolio and careers · 10 questions · 15 min, without help. 4 topics of this module still to finish first.
- 43 topics left in the course before the final exam.
← Previous: The C# and .NET interview questions asked most often