Earn More by Sharing What You Love
Do you create content for developers working with .NET, C#, Java, Python, or Node.js? Turn your expertise into extra income!

Tim Corey
44m 57s
When starting a C# Web API project, developers are often faced with an overwhelming number of choices for how to structure their code. Should you follow a layered ASP.NET Core Web API pattern? Should you stick to the controllers folder from the default template in Visual Studio? Or should you try a more modern style like Minimal APIs?
In his video, "Keep Your Project Structure Simple!", Derek Comartin from CodeOpinion.com takes an opinionated but refreshingly practical stance. He walks through his ideas for building and organizing a Web API in a way that works for real-world software systems, focusing on what actually matters: simplicity.
This article follows Derek's video step by step, to guide you through how to structure an ASP.NET Core Web API project for clarity, maintainability, and real-world scalability.
Derek begins by asking the question most developers hit when creating a new Web API project in Visual Studio:
"How should you structure your HTTP API?"
He immediately acknowledges that Web API projects can be organized in many ways. Among the most common folder structures Derek sees:
Derek stresses that each of these patterns can create a RESTful API that uses the HTTP methods you'd expect (GET, POST, PUT, DELETE) to work with resources. But he warns against reading too much into folder structures alone:
"You might see entities, aggregates, or domain services, but that doesn't mean the code is really doing domain-driven design - it's just using those patterns."
Derek says his goal is straightforward:
"One of the main things I wanted to achieve with this structure is simplicity."
Rather than jumping into a heavy .NET Framework style architecture or replicating patterns from textbooks, Derek chooses ASP.NET Core Minimal APIs. Why? Because they make it easy to create APIs without the overhead of controllers and boilerplate code.
When you build a new Web API project in Visual Studio or even Visual Studio Code, you might start with the New Project Dialog and select ASP.NET Core Web API. By default, you'll get controllers, folders, and a lot of scaffolding. Derek argues that starting smaller - a simple, clean structure - is often better.
Derek introduces his web application structure using .NET Core. It's built to support common HTTP services and RESTful APIs that allow different software applications to communicate.
Here's how he organizes his web API project:
{id}, POST /posts, PUT /posts/{id}, and DELETE /posts/{id}.By grouping endpoints by feature, Derek avoids spreading logic across multiple unrelated folders.
Derek has used Domain-Driven Design in the past, but in this C# Web API structure he makes a key choice:
"We're not going to be using domain-driven design."
Instead, he "just lets data be data." His data models are plain classes with simple properties like:
public class Post
{
public int Id { get; set; }
public string Title { get; set; }
}Public Class Post
Public Property Id As Integer
Public Property Title As String
End ClassNo unnecessary behavior is crammed in. When you send a POST request to create a new resource, the API simply saves it. When you send a DELETE request with an id parameter, it deletes that resource.
This approach embraces the architectural style of Representational State Transfer (REST) by treating API endpoints as verbs (get method, post method, put method, delete method) acting on resources like Post, User, or Comment.
At this point, Derek opens his Visual Studio solution and gives us a tour:
This clean project folder layout avoids the mess of digging through an overly complex project dialog or a scattered controllers folder.
Derek explains that each endpoint in his ASP.NET Core Web API is a self-contained unit of work with three clear steps:
{id} to a handler method.Because Derek uses Minimal APIs, these handlers are static methods. With ASP.NET Core, this means you can inject dependencies directly - no bulky controller class needed.
Derek praises Minimal APIs for their simplicity. With ASP.NET Core's minimal template, you can start a web API project with just a few lines in Program.cs:
var app = WebApplication.CreateBuilder(args).Build();Dim app = WebApplication.CreateBuilder(args).Build()From there, you add your get methods, post methods, and put requests in a straightforward way.
This simplicity helps avoid over-engineering - something Derek sees all too often when developers blindly copy nuget package templates or force new controller classes for every minor endpoint.
Derek gives a real example: the "like a post" feature.
This opens new challenges:
Derek shows that as complexity grows, you might add patterns like:
But his key point is clear:
"Don't start here. Start with simple and evolve only if needed."
Derek ends by returning to his main lesson for C# Web API developers:
"Start with simple."
When you use ASP.NET Core Web API or ASP.NET Web API in Visual Studio, it's easy to over-engineer from day one - adding every folder, pattern, and NuGet package you've ever seen.
But Derek warns: don't apply solutions blindly. Understand the HTTP methods you need, the data you're working with, and the software systems you're enabling communication between. Build your RESTful APIs step by step.
For those using Visual Studio Code or any other integrated development environment, his advice holds true: Whether it's a new project or an existing resource, keep your project structure as simple as possible, and only add patterns when real-world complexity demands it.
Derek Comartin's video is more than just a guide for building a C# Web API - it's a reminder that good architecture starts with clarity, not clutter. By walking through his real-world ASP.NET Core Web API setup in Visual Studio, he shows how Minimal APIs, feature folders, and straightforward data models can form the foundation for RESTful APIs that enable seamless communication between different software applications without overcomplicating the design.
If you want to see this approach in action and hear Derek's perspective firsthand, his video is an excellent resource. His channel is filled with equally insightful discussions on software systems, web services, and ASP.NET Core development - a must-follow for any developer looking to improve their craft and keep their projects clean, practical, and future-friendly.
Do you create content for developers working with .NET, C#, Java, Python, or Node.js? Turn your expertise into extra income!
Join our newsletter, you’ll get exclusive access on article updates. We value your privacy