当前位置:网站首页>Projects and dependencies in ABP learning solutions
Projects and dependencies in ABP learning solutions
2022-07-01 06:07:00 【Old sentencing】
.Domain.Share project
The project contains constants 、 Enumerations and other objects , These objects are actually part of the domain layer , But all the layers in the solution / Projects will use . For example, entity class Book Enumeration used in BookType、 Constant
BookConstsAre suitable for this project .
This project does not depend on other projects in the solution , Introduction to other projects or directly rely on this project
.Domain project
The domain layer in the solution , contain Entity , Set root , Field service , Value type , Warehousing interfaces and other domain objects of the solution . For example, entities and IBookRepository Classes are suitable for this project
It relies on .Domain.Share Because it may be in the application interface and DTO Use constants in 、 Enumeration or other shared objects .
.Application.Contracts project
The project mainly includes application services interfaces And application layer data transmission objects DTO, It is used to separate the interface and implementation of the application layer , In this way, the interface project can be shared to the client as a contract package .
for example IBookAppService Interface and BookCreationDto Classes are suitable for this project
It depends on .Domain.Share because He may be in the application interface and DTO Use constants in 、 Enumeration or other shared objects .
.Application project
Project contains .Application.COntracts Implementation of the application service interface of the project .
for example BookAppService Class is suitable for this project
It relies on .Application.Cantracts project , Because it needs to implement interfaces and use DTO It depends on .Domain.Share because He may be in the application interface and DTO Use constants in 、 Enumeration or other shared objects .
.EntityFrameworkCore project
Integrate EF Core project , Defined DbContext And implement .Domain Warehouse interface defined in the project
It relies on .Domain project . Because it needs to reference entities and warehousing interfaces
.EntityFrameworkCore.DbMigrations project
Included in the solution EF Core Database migration for , It has independent DbContext To specifically manage migration
ABP It's a modular framework , The ideal design is to let each module have its own DbContext class , This is for migration DbContext It will work , He will all DbContext The configuration is unified into a single model to maintain the schema of a single database , For more advanced scenarios , Programs can have multiple databases ( Each database has one or more module tables ) And multiple migrations
DbContext( Each maintains a different database schema )
We need to pay attention to , transfer
DbContextFor database migration only , Instead of Runtime Use .
- It relies on
.EntityFrameworkCoreproject , Because it reuses theDbContextTo configure
.DbMigrator project
This is a console application , It simplifies database migration in development and production environments , When you use it :
Create a database when necessary ( Without a database )
Apply data migration without migration
Initialize seed data ( When you need it )
Although creating databases and applying migrations seems only useful for relational databases , But even if you choose NoSQL Database provider ( Such as MongoDB), This project will also be generated . At this time , It will provide the necessary initial data for the application .
- It relies on
.EntityFrameworkCore.DbMigrationsproject ( in the light of EF Core), Because it needs to access the migration file .- It relies on
.Application.Contractsproject , Because it requires access permission definitions to give all permissions to the administrator user when initializing seed data .
.HttpApi project
Used for definition API controller
Most of the time , You don't need to define it manually API controller , because ABP The dynamics of the API The function will be automatically created according to the application layer API controller , But if you need to write API controller , Then it is the most suitable place
It relies on .Application.Contracts project , Because it needs to inject the application service interface
.HttpApi.Client project
Definition C# The client agent uses... In the solution Http API project , You can share your edits to third-party clients , Make it easy in DotNet Use your http API
ABP Yes dynamic C# API client function , So in most cases, you don't need to create it manually C# Client agent .
.HttpApi.Client.ConsoleTestAppThe project is a console application that demonstrates the use of client agents .
- It relies on
.Application.Contractsproject , Because it needs to use application service interface and DTO.If you don't need to be API Create dynamic C# Client agent , You can delete this project and dependencies
.Web project
Contains the user interface of the application (UI). If you use ASP.NET Core MVC UI, Contains the main of the application
appsettings.jsonThe configuration file , Used to configure the database connection string and other configurations of the application
rely on
.HttpApiproject , because UI The layer needs to use the... Of the solution API And application service interface .
. Hierarchical structure
If you choose ASP.NET core UI And designated --tiered Options ,CLI Will create tiered solutions , The purpose of the hierarchical structure is to Web Applications and Http Api Deploy to different servers
References :Startup Templates/Application | Documentation Center | ABP.IO
The purpose of writing this article is to facilitate my study ABP
边栏推荐
- 利用百度地图查询全国地铁线路
- Small guide for rapid completion of mechanical arm (VI): stepping motor driver
- OpenGL es: (2) relationship between OpenGL es, EGL and glsl
- 【文件系统】如何在ubi之上运行squashfs
- TIDB数据库特性总结
- DHT11 温湿度传感器
- OpenGL ES: (3) EGL、EGL绘图的基本步骤、EGLSurface、ANativeWindow
- 2022 年面向初学者的 10 大免费 3D 建模软件
- ABP 学习解决方案中的项目以及依赖关系
- SystemVerilog学习-09-进程间同步、通信和虚方法
猜你喜欢

PLA不粘貼在床上:6個簡單的解决方案

基于LabVIEW的计时器

【笔记】电商订单数据分析实战

千万不要把笔记视频乱放!

3D打印机穿线:5种简单的解决方案

穿越派·派盘 + Mountain Duck = 数据本地管理

68 Cesium代码datasource加载czml

Database problems, how to optimize Oracle SQL query statements faster and more efficient

论文学习记录随笔 多标签之GLOCAL

One of the characteristic agricultural products that make Tiantou village, Guankou Town, Xiamen into a "sweet" village is
随机推荐
C language beginner level - realize the minesweeping game
Preliminary level of C language -- selected good questions on niuke.com
Orcle创建用户+角色
Small guide for rapid completion of mechanical arm (VI): stepping motor driver
基于LabVIEW的计时器
蚂蚁新村田头村变甜头村 让厦门灌口镇田头村变甜头村的特色农产品之一是
DHT11 温湿度传感器
excel初级应用案例——杜邦分析仪
千万不要把笔记视频乱放!
68 cesium code datasource loading czml
Cjc8988 Low Power Stereo codec with 2 stereo headphone drivers
FPGA - 7系列 FPGA内部结构之Clocking -01- 时钟架构概述
TiDB单机模拟部署生产环境集群(闭坑实践,亲测有效)
golang panic recover自定义异常处理
OpenGL es: (3) EGL, basic steps of EGL drawing, eglsurface, anativewindow
excel動態圖錶
Excel dynamic chart
JDBC connection pool
Dear pie users, I want to confess to you!
Code shoe set - mt3149 · and - the data is not very strong. Violent pruning can deceive AC