32 | @RenderBody()
33 |
34 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/Presentation/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "~/Shared/Views/_Layout.cshtml";
3 | }
4 |
--------------------------------------------------------------------------------
/Presentation/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Presentation/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | },
8 | "AllowedHosts": "*",
9 | "ConnectionStrings": {
10 | "CleanArchitectureCore": "Server=(local);Database=CleanArchitectureCore;Trusted_Connection=True;"
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Clean Architecture Demo
2 | A sample application for [Clean Architecture: Patterns, Practices, and Principles](https://pluralsight.pxf.io/clean-architecture) using Microsoft .NET Core 6.0.
3 |
4 | This sample application is intended to be a learning tool for clean architecture practices. It incorporates several of these practices in a way that is simple and easy to understand.
5 |
6 | If you'd like to learn more about this style of software architecture, please check out my online course [Clean Architecture: Patterns, Practices, and Principles](https://pluralsight.pxf.io/clean-architecture).
7 |
8 | ## Technologies
9 | This demo application uses the following technologies:
10 | - .NET Core 6.0
11 | - C# .NET 10.0
12 | - ASP.NET Core MVC 6.0
13 | - EF Core 6.0
14 | - Visual Studio 2022
15 | - SQL Server 2019
16 | - Scrutor 4.2
17 | - NUnit 3.13
18 | - Moq 4.18
19 | - SpecFlow 3.9
20 |
21 | ## Other Versions
22 | For other versions of this sample application, please see the following:
23 | - [.NET Framework 4.8](https://github.com/matthewrenze/clean-architecture-demo)
24 | - [.NET Framework 4.5](https://github.com/matthewrenze/clean-architecture-demo/tree/v4.5)
--------------------------------------------------------------------------------
/Service/Customers/CustomersController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using Microsoft.AspNetCore.Mvc;
5 | using CleanArchitecture.Application.Customers.Queries.GetCustomerList;
6 |
7 | namespace CleanArchitecture.Service.Customers
8 | {
9 | [ApiController]
10 | [Route("api/[controller]")]
11 | public class CustomersController : ControllerBase
12 | {
13 | private readonly IGetCustomersListQuery _query;
14 |
15 | public CustomersController(IGetCustomersListQuery query)
16 | {
17 | _query = query;
18 | }
19 |
20 | [HttpGet]
21 | public IEnumerable