This N-Layered Architecture with .Net Core 2.1 project (NLayerAppV3) is retro rebuild new code project based on DDD N-LayeredArchitecture Version 2. It contains all DDD Layers where the developer and software architect may reuse to implement a .Net Core WebApi (Version 2.1) for Banking and Blog Contexts. Why to use .NET Core 2.1? We need to use this version because of EF Core Complex Types - Value Object implementation (OwnsOne) and TransactionScope implementation using in Application Layer. This project is a tribute to the recent visit to Madrid of Cesar de la Torre in order to give us an amazing conference called 'Microservices Architectures' [https://geeks.ms/plainnews/2017/05/04/microservices-architectures/].
- Main Bounded Context [http://nlayerappv3mainboundedcontext.azurewebsites.net]
- Blog Bounded Context [http://nlayerappv3blogboundedcontext.azurewebsites.net]
Install the .NET Core 2.1 runtime for your host environment from [https://www.microsoft.com/net/core/] (https://www.microsoft.com/net/core/)
In a terminal, navigate to the folder of this project and type the following to restore the dependencies:
dotnet restore
To start the API, navigate to the 'DistributedServices.MainBoundedContext' folder and type:
dotnet run
Browse to http://localhost:5000/ to see the result.
To run the tests, navigate to the 'DistributedServices.MainBoundedContext.Tests' or antoher test project folder and type:
dotnet test
The solution consists of sixteen projects: the API, Application, Domain and infrastructure projects.
- DistributedServices.MainBoundedContext
- DistributedServices.MainBoundedContext.Tests
- Application.Seedwork
- Application.MainBoundedContext
- Application.MainBoundedContext.DTO
- Application.MainBoundedContext.Tests
- Domain.Seedwork
- Domain.Seedwork.Tests
- Domain.MainBoundedContext
- Domain.MainBoundedContext.Tests
- Infrastructure.Data.Seedwork
- Infrastructure.Data.MainBoundedContext
- Infrastructure.Data.MainBoundedContext.Tests
- Infrastructure.Crosscutting
- Infrastructure.Crosscutting.NetFramework
- Infrastructure.Crosscutting.Tests
This project contains the API controllers (sync and async methods).
- Microsoft.NETCore.App: A set of .NET API's that are included in the default .NET Core application model.
This project contains the integration and unit tests.
- TestHost: for in-process API testing
- xUnit: as the testing framework
- Newtonsoft.Json: for JSON deserialization
- FluentAssertions: to write beautiful assertions with Should().
- Moq: Moq is intended to be simple to use, strongly typed and minimalistic (while still fully functional!).
This project contains Error Exceptions and Projections Extensions.
- Microsoft.NETCore.App: A set of .NET API's that are included in the default .NET Core application model.
This project contains the modules and an anemic generic application common service.
- Microsoft.Extensions.Logging: Logging.
This project contains the DTOs, profiles and validations.
- Automapper: A convention-based object-object mapper
- Fluent Validation: A small validation library for .NET
- Newtonsoft.Json: for JSON deserialization
This project contains the adapters and application services tests.
- xUnit: as the testing framework
- Moq: Moq is intended to be simple to use, strongly typed and minimalistic (while still fully functional!).
This project contains the base entities with guid, int and string identities, value object and auditable classes.
- Microsoft.NETCore.App: A set of .NET API's that are included in the default .NET Core application model.
This project contains unit tests.
- xUnit: as the testing framework
This project contains the aggregates, domains entities, value objects, factories, specifications and the repositories interfaces.
- Microsoft.NETCore.App: A set of .NET API's that are included in the default .NET Core application model.
This project contains unit tests of the domain entities, value objects, ....
- xUnit: as the testing framework
This project contains the Repository base class and some interfaces.
- Microsoft.EntityFrameworkCore.InMemory: In-memory database provider for Entity Framework Core (to be used for testing purposes).
This project contains the repositories.
- Microsoft.EntityFrameworkCore.InMemory: In-memory database provider for Entity Framework Core (to be used for testing purposes).
- System.Security.Claims: Provides classes that implement claims-based identity.
This project contains the repository unit tests.
- xUnit: as the testing framework
This project contains the Adapters, Localization and Validator Crosscutting definitions.
- Microsoft.NETCore.App: A set of .NET API's that are included in the default .NET Core application model.
This project contains the Adapters, Localization and Validator Crosscutting factory implementations.
- Microsoft.NETCore.App: A set of .NET API's that are included in the default .NET Core application model.
This project contains the crosscutting unit tests.
- xUnit: as the testing framework
- Announcing .NET Core 2.0: https://blogs.msdn.microsoft.com/dotnet/2017/08/14/announcing-net-core-2-0/
- .NET Core 2.0 Preview 2 Release Notes: https://github.com/dotnet/core/blob/master/release-notes/2.0/2.0.0-preview2.md
- 2.0.0 Preview 2 Known Issues: https://github.com/dotnet/core/blob/master/release-notes/2.0/2.0.0-preview2-known-issues.md
- .NET Core Roadmap: https://github.com/dotnet/core/blob/master/release-notes/2.0/2.0.0-preview1-known-issues.md
- .NET Core 2.0 Changes – Things to Know: https://stackify.com/net-core-2-0-changes/
- Our brand-new ‘DDD N-Layered .NET 4.0 Architecture Guide’ book and Sample-App in CODEPLEX: https://blogs.msdn.microsoft.com/cesardelatorre/2010/03/25/our-brand-new-ddd-n-layered-net-4-0-architecture-guide-book-and-sample-app-in-codeplex/
- .Net Core Localization.
- Docker.
- FrontEnd implementation with Angular.
- More tests.
- Store Procedures execution with ef core.
- Versioning.
- Security with Identity Server4.
- Cache.
Feedback about this project is greatly appreciated.
2017 César Castro and Microsoft Corporation