How carlosdevelopp/crud_movies_store works
Project Type and Purpose
• This is a server-side Web API project built in C# using ASP.NET Core 8.0. It implements a classic three-layer architecture:
• Presentation layer: an ASP.NET Core Web API (“MoviesStore” project)
• Business/infrastructure layer: service interfaces, DTOs and business logic (“Infrastructure” project)
• Data access layer: Entity Framework Core context, repository implementations and database models (“DataAccess” project)
• Its purpose is to expose CRUD operations on movie-related entities (Movies, Actors, Genres, Awards) backed by a SQL Server 2019 database.
Directory Structure and Architectural Patterns
• Top-level solution file (MoviesStore.sln) orchestrates three projects:
• MoviesStore (the Web API host)
• Infrastructure (service contracts, DTOs, service implementations)
• DataAccess (EF Core DbContext, repository pattern)
• Patterns in use:
• Layered (Presentation → Infrastructure → DataAccess → Database)
• Repository/Unit-of-Work (MoviesDataAccess.cs over ApplicationDbContext)
• DTOs for data transfer between layers
• Dependency Injection (built-in ASP.NET Core DI container)
Key Components
a. Presentation Layer (ASP.NET Core Web API)
• MoviesController (handles HTTP requests)
• Program/Startup (application host, middleware pipeline, DI registration)
• Configuration files (appsettings.json)
b. Infrastructure Layer
• IMoviesInfrastructure (service contract)
• MoviesInfrastructure (business logic, data mapping between DTOs and entities)
• DTO types (MoviesDTO, ActorsDTO, etc.)
c. Data Access Layer
• IMoviesDataAccess (repository contract)
• MoviesDataAccess (EF Core repository)
• ApplicationDbContext (DbContext with DbSet<Tables>)
• EF Core entity models (Movies, Actors, Genres, Awards, MoviesActors join table)
d. External Systems
• SQL Server 2019 database instance
• (Optional) Swagger/OpenAPI if used
• (Optional) Logging/Monitoring sinks
Relationships and Data Flow
• HTTP client → ASP.NET Core Web API (MoviesController)
• Controller calls MoviesInfrastructure via IMoviesInfrastructure
• MoviesInfrastructure calls MoviesDataAccess via IMoviesDataAccess
• MoviesDataAccess uses ApplicationDbContext to query/update SQL Server
• Results flow back up: EF entity → Infrastructure DTO → HTTP response
Architectural Patterns and Technologies
• Layered architecture with clear separation of concerns
• Repository pattern for data operations, hiding ORM details
• DTO mapping in Infrastructure layer to decouple API from EF entities
• EF Core for ORM, SQL Server 2019 as the persistent store
• ASP.NET Core 8.0 for hosting Web API, dependency injection, configuration, middleware
Final Checklist
• Four layers: Client / Presentation / Infrastructure / Data Access / Database
• Key components in each layer, clearly labeled
• Callouts for major technologies: ASP.NET Core 8.0, EF Core, SQL Server 2019