You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Repository include layers divided by **4 project**;
110
-
* Core
111
-
* Entities
112
-
* Interfaces
113
-
* Specifications
114
-
* ValueObjects
115
-
* Exceptions
116
-
* Application
117
-
* Interfaces
118
-
* Services
119
-
* Dtos
120
-
* Mapper
121
-
* Exceptions
122
-
* Infrastructure
123
-
* Data
124
-
* Repository
125
-
* Services
126
-
* Migrations
127
-
* Logging
128
-
* Exceptions
129
-
* Web
130
-
* Interfaces
131
-
* Services
132
-
* Pages
133
-
* ViewModels
134
-
* Extensions
135
-
* Mapper
136
-
137
-
### Core Layer
138
-
Development of Domain Logic with abstraction. Interfaces drives business requirements with light implementation. The Core project is the **center of the Clean Architecture** design, and all other project dependencies should point toward it.
139
-
140
-
#### Entities
141
-
Includes Entity Framework Core Entities which creates sql table with **Entity Framework Core Code First Aproach**. Some Aggregate folders holds entity and aggregates.
142
-
You can see example of **code-first** Entity definition as below;
Applying domain driven approach, Product class responsible to create Product instance.
175
-
176
-
#### Interfaces
177
-
Abstraction of Repository - Domain repositories (IAsyncRepository - IProductRepository) - Specifications etc.. This interfaces include database operations without any application and ui responsibilities.
178
-
179
-
#### Specifications
180
-
This folder is implementation of **[specification pattern](https://en.wikipedia.org/wiki/Specification_pattern)**. Creates custom scripts with using **ISpecification** interface. Using BaseSpecification managing Criteria, Includes, OrderBy, Paging.
181
-
This specs runs when EF commands working with passing spec. This specs implemented SpecificationEvaluator.cs and creates query to AspnetRunRepository.cs in ApplySpecification method.This helps create custom queries.
182
-
183
-
### Infrastructure Layer
184
-
Implementation of Core interfaces in this project with **Entity Framework Core** and other dependencies.
185
-
Most of your application's dependence on external resources should be implemented in classes defined in the Infrastructure project. These classes must implement the interfaces defined in Core. If you have a very large project with many dependencies, it may make sense to have more than one Infrastructure project (eg Infrastructure.Data), but in most projects one Infrastructure project that contains folders works well.
186
-
This could be includes, for example, **e-mail providers, file access, web api clients**, etc. For now this repository only dependend sample data access and basic domain actions, by this way there will be no direct links to your Core or UI projects.
187
-
188
-
#### Data
109
+
AspnetRunBasic has only **one solution** and into this solution only **one web application project** which include all components of project structure. The idea is that **fast implementation, minimum development, bootstrap your idea, create Minimum Viable Product (MVP), idea validation, startup development implementation** for a **limited time** and **limited resources** with using asp.net core and entity framework core.
110
+
111
+
Repository include folders for group implementations;
112
+
* Data
113
+
* AspnetRunContext
114
+
* AspnetRunContextSeed
115
+
* Entities
116
+
* Product
117
+
* Category
118
+
* Migrations
119
+
* Generated by scaffolding from ef.core
120
+
* Pages
121
+
* Default Razor Web Application Template of Asp.Net Core
122
+
* Repositories
123
+
* IProductRepository
124
+
* ProductRepository
125
+
126
+
### Data Folder
189
127
Includes **Entity Framework Core Context** and tables in this folder. When new entity created, it should add to context and configure in context.
190
128
The Infrastructure project depends on Microsoft.**EntityFrameworkCore.SqlServer** and EF.Core related nuget packages, you can check nuget packages of Infrastructure layer. If you want to change your data access layer, it can easily be replaced with a lighter-weight ORM like Dapper.
191
129
192
130
#### Migrations
193
131
EF add-migration classes.
194
132
#### Repository
195
-
EF Repository and Specification implementation. This class responsible to create queries, includes, where conditions etc..
196
-
#### Services
197
-
Custom services implementation, like email, cron jobs etc.
133
+
EF Repository implementation. This class responsible to create queries, includes, where conditions etc..
198
134
199
-
###Application Layer
200
-
Development of **Domain Logic with implementation**. Interfaces drives business requirements and implementations in this layer.
201
-
Application layer defines that user required actions in app services classes as below way;
135
+
#### Entities Folder
136
+
Includes Entity Framework Core Entities which creates sql table with **Entity Framework Core Code First Aproach**. Some Aggregate folders holds entity and aggregates.
137
+
You can see example of **code-first** Entity definition as below;
In this layer we can add validation , authorization, logging, exception handling etc. -- cross cutting activities should be handled in here.
237
156
238
-
### Web Layer
239
-
Development of UI Logic with implementation. Interfaces drives business requirements and implementations in this layer.
240
-
The application's main **starting point** is the ASP.NET Core web project. This is a classical console application, with a public static void Main method in Program.cs. It currently uses the default **ASP.NET Core project template** which based on **Razor Pages** templates. This includes appsettings.json file plus environment variables in order to stored configuration parameters, and is configured in Startup.cs.
157
+
### Repository Folder
158
+
Implementation of Core interfaces in this project with **Entity Framework Core** and other dependencies.
159
+
Most of your application's dependence on external resources should be implemented in classes defined in the Infrastructure project. These classes must implement the interfaces defined in Core. If you have a very large project with many dependencies, it may make sense to have more than one Infrastructure project (eg Infrastructure.Data), but in most projects one Infrastructure project that contains folders works well.
160
+
This could be includes, for example, **e-mail providers, file access, web api clients**, etc. For now this repository only dependend sample data access and basic domain actions, by this way there will be no direct links to your Core or UI projects.
241
161
242
-
Web layer defines that user required actions in page services classes as below way;
For each layer, there is a test project which includes intended layer dependencies and mock classes. So that means Core-Application-Infrastructure and Web layer has their own test layer. By this way this test projects also divided by **unit, functional and integration tests** defined by in which layer it is implemented.
289
-
Test projects using **xunit and Mock libraries**. xunit, because that's what ASP.NET Core uses internally to test the product. Moq, because perform to create fake objects clearly and its very modular.
198
+
199
+
200
+
### Pages Folder
201
+
Development of UI Logic with implementation. Interfaces drives business requirements and implementations in this layer.
202
+
The application's main **starting point** is the ASP.NET Core web project. This is a classical consoleapplication, withapublicstaticvoidMainmethodinProgram.cs. Itcurrentlyusesthedefault **ASP.NETCoreprojecttemplate** whichbasedon **RazorPages** templates. Thisincludesappsettings.jsonfileplusenvironmentvariablesinordertostoredconfigurationparameters, andisconfiguredinStartup.cs.
290
203
291
204
292
205
## Technologies
@@ -297,16 +210,14 @@ Test projects using **xunit and Mock libraries**. xunit, because that's what AS
297
210
* RazorPages
298
211
* AutoMapper
299
212
300
-
## Architecture
301
-
* Clean Architecture
302
-
* Full architecture with responsibility separation of concerns
303
-
* SOLID and Clean Code
304
-
* Domain Driven Design (Layers and Domain Model Pattern)
0 commit comments