https://github.com/azerato/myapp-sample-architecture
Sample C# ASP .NET Project Architecture
https://github.com/azerato/myapp-sample-architecture
api architecture asp csharp dbset dependency-injection dependency-injection-container domain-driven-design dotnet dto entity-framework entityframework repository repository-pattern unitofwork unity
Last synced: 8 months ago
JSON representation
Sample C# ASP .NET Project Architecture
- Host: GitHub
- URL: https://github.com/azerato/myapp-sample-architecture
- Owner: aZerato
- Created: 2017-03-16T08:51:06.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-24T16:53:35.000Z (about 9 years ago)
- Last Synced: 2025-03-11T16:49:11.136Z (about 1 year ago)
- Topics: api, architecture, asp, csharp, dbset, dependency-injection, dependency-injection-container, domain-driven-design, dotnet, dto, entity-framework, entityframework, repository, repository-pattern, unitofwork, unity
- Language: C#
- Homepage:
- Size: 443 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sample ASP .NET Architecture
Pattern [Domain-Driven Design](http://dddcommunity.org/) DDD
## 01 - Presentation
> The user interface layer
Basic API :
- Controller "Sample" is used for DI & sample of CacheManager class.
- Controller "SampleAlt" is used for demonstrate the using of "services" > "repository" > "UoW" > "EF"
## 02 - Domain
> The data management layer
- Use "module" conception : services interfaces with their implementation (Module : aggregates/services [DDD])
- DTO : Data Transfer Object (sample: MyApp.Domain.DTO.SampleDataDTO).
- The [Specification Pattern](https://github.com/jnicolau/NSpecifications) (soon).
- "Select Builder" : Thanks to LINQ you are able to create custom expression for return directly an DTO (sample: MyApp.Domain.SampleModule.Aggregates.SampleDataSelectBuilder).
## 03 - Data
> The data access layer
- Use EntityFramework (EF) with DbSet/Annotations for link a SQL/Table to a class/object (sample: MyApp.Domain.SampleModule.Aggregates.SampleData).
- The [Unit Of Work (UnitOfWork / UoW) Pattern](https://martinfowler.com/eaaCatalog/unitOfWork.html) add transactions for the resolution of concurrency problems (MyApp.Data.UnitOfWorkContext).
- The [Repository Pattern](https://msdn.microsoft.com/en-us/library/ff649690.aspx) add a layer between DbSet (return IQueryable) with UoW and the data used in "Domain" layer.
Queryable manipulation is sensible, a Repository return an Enumerable or an Entity. (MyApp.Data.Core.Repository && MyApp.Domain.Core.IRepository)
## 04 - Infrastructure
> The app management layer
- CrossCutting : a layer can be used in all others.
- The [Inversion Of Control](https://msdn.microsoft.com/en-us/library/ff921087.aspx).
- Dependancy Injection (DI) & [LifeTimeManager](https://msdn.microsoft.com/en-us/library/ff647854.aspx).