/AspCore.SampleAPI

Clean Architecture / Domain / Behaviors / Queries / AutoMapper / Swagger / Functional testing / CI

Primary LanguageC#MIT LicenseMIT

Sample API

Build status

This is an example ASP Core project that tries to show how to create a simple project balancing an agile coding within a structured solution, avoiding unnecessary complexity.

Instructions to RUN locally.

  • Open Solution.

  • Execute migrations (From the Package Manager Console type: update-database).

  • Run!

Project structure

  • SampleApi.Domain:

    • Behaviors: Business logic.
    • Infrastructure: Repository contracts.
    • Models: Domain models.
  • SampleApi:

    • Commands: Actions that can be executed by the controllers.
    • Controllers: They contain mappings and calls to behaviors or queries to execute the requested action. If you prefer, you can move mappings to the behaviors class (or a new intermediate component) to make your controllers completely dump, both options are still valid. ;)
    • Infrastructure: Application DbContext and repositories implementations.
    • Mappings: AutoMapper profiles.
    • Migrations: EF Core migrations and Data Seeds.
    • Queries: Data retrieval components.
    • ViewModels: Models to display info in the UI.

More information