An awesome guide on how to build RESTful APIs with ASP.NET Core

An awesome guide on how to build RESTful APIs with ASP.NET Core

by Evandro Gomes

RESTful is not a new term. It refers to an architectural style where web services receive and send data from and to client apps. The goal of these applications is to centralize data that different client apps will use.

This is a companion discussion topic for the original entry at

Just a question, why isnt AppDbContext declared under the namespace Supermarket.API.Persistence.Context but instead its under Supermarket.API.Domain.Persistence.Context? Almost all others seem to follow folder structure as their namespace

Sorry I don’t mean to sound horrible but this is a post of how not to do things, there are good examples here of anti-patterns and usual beginner pitfalls. It’s fine though we all have to start somewhere, and there is always more to learn.

  1. You are abstracting abstractions for no reason, DI and the ORM are already an abstractions

  2. AutoMapper is generally a anti-pattern for anything more than boring left-hand-side right-hand-side code called out by it’s creator If in doubt don’t use.

  3. The repository pattern is considered an anti-pattern by anyone that matters, consider replacing with the Command Pattern

Consider reading these articles and adjusting your post.