Merge pull request #12623 from abpframework/auto-merge/rel-5-2/1070

Merge branch rel-5.3 with rel-5.2
pull/12627/head
Halil İbrahim Kalkan 4 years ago committed by GitHub
commit d745f4328b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -23,8 +23,8 @@ One common advise to start a new solution is **always to start with a monolith**
However, developing such a well-modular application can be a problem since it is **hard to keep modules isolated** from each other as you would do it for microservices (see [Stefan Tilkov's article](https://martinfowler.com/articles/dont-start-monolith.html) about that). Microservice architecture naturally forces you to develop well isolated services, but in a modular monolithic application it's easy to tight couple modules to each other and design **weak module boundaries** and API contracts.
ABP can help you in that point by offerring a **microservice-compatible, strict module architecture** where your module is splitted into multiple layers/projects and developed in its own VS solution completely isolated and independent from other modules. Such a developed module is a natural microservice yet it can be easily plugged-in a monolithic application. See the [module development best practice guide](Best-Practices/Index.md) that offers a **microservice-first module design**. All [standard ABP modules](https://github.com/abpframework/abp/tree/master/modules) are developed based on this guide. So, you can use these modules by embedding into your monolithic solution or deploy them separately and use via remote APIs. They can share a single database or can have their own database based on your simple configuration.
ABP can help you in that point by offering a **microservice-compatible, strict module architecture** where your module is split into multiple layers/projects and developed in its own VS solution completely isolated and independent from other modules. Such a developed module is a natural microservice yet it can be easily plugged-in a monolithic application. See the [module development best practice guide](Best-Practices/Index.md) that offers a **microservice-first module design**. All [standard ABP modules](https://github.com/abpframework/abp/tree/master/modules) are developed based on this guide. So, you can use these modules by embedding into your monolithic solution or deploy them separately and use via remote APIs. They can share a single database or can have their own database based on your simple configuration.
## Microservice Demo Solution
## Microservice Demo Solution: eShopOnAbp
The [sample microservice solution](Samples/Microservice-Demo.md) demonstrates a complete microservice solution based on the ABP framework.
The [eShopOnAbp project](https://github.com/abpframework/eShopOnAbp) demonstrates a complete microservice solution based on the ABP framework.

@ -2,15 +2,19 @@
Here, a list of official samples built with the ABP Framework. Most of these samples are located under the [abpframework/abp-samples](https://github.com/abpframework/abp-samples) GitHub repository.
### Microservice Demo
## eShopOnAbp
A complete solution to demonstrate how to build systems based on the microservice architecture.
Reference microservice solution built with the ABP Framework and .NET.
* [The complete documentation for this sample](Microservice-Demo.md)
* [Source code](https://github.com/abpframework/abp-samples/tree/master/MicroserviceDemo)
* [Microservice architecture document](../Microservice-Architecture.md)
* [Source code](https://github.com/abpframework/eShopOnAbp)
### Book Store
## EventHub
This is a reference application built with the ABP Framework. It implements the Domain Driven Design with multiple application layers.
* [Source code](https://github.com/abpframework/eventhub)
## Book Store
A simple CRUD application to show basic principles of developing an application with the ABP Framework. The same sample was implemented with different technologies:
@ -28,7 +32,7 @@ A simple CRUD application to show basic principles of developing an application
While there is no Razor Pages & MongoDB combination, you can check both documents to understand it since DB & UI selection don't effect each other.
### Other Samples
## Other Samples
* **Event Organizer**: A sample application to create events (meetups) and allow others to register the events. Developed using EF Core and Blazor UI.
* [Source code](https://github.com/abpframework/abp-samples/tree/master/EventOrganizer)

@ -1,5 +1,7 @@
# Microservice Demo Solution
> This solution is no longer maintained. See [the eShopOnAbp project](https://github.com/abpframework/eShopOnAbp) for the replacement solution.
*"Microservices are a software development technique—a variant of the **service-oriented architecture** (SOA) architectural style that structures an application as a collection of **loosely coupled services**. In a microservices architecture, services are **fine-grained** and the protocols are **lightweight**. The benefit of decomposing an application into different smaller services is that it improves **modularity**. This makes the application easier to understand, develop, test, and become more resilient to architecture erosion. It **parallelizes development** by enabling small autonomous teams to **develop, deploy and scale** their respective services independently. It also allows the architecture of an individual service to emerge through **continuous refactoring**. Microservices-based architectures enable **continuous delivery and deployment**."*
— [Wikipedia](https://en.wikipedia.org/wiki/Microservices)

@ -1316,7 +1316,15 @@
"path": "Samples/Index.md"
},
{
"text": "Microservice Demo",
"text": "eShopOnAbp",
"path": "https://github.com/abpframework/eShopOnAbp"
},
{
"text": "EventHub",
"path": "https://github.com/abpframework/eventhub"
},
{
"text": "Microservice Demo (legacy)",
"path": "Samples/Microservice-Demo.md"
}
]

@ -84,7 +84,7 @@ namespace AbpDemo
#### 关于序列化的事件对象
事件传输对象**必须是可序列化**的,因为将其传输到程外时,它们将被序列化/反序列化为JSON或其他格式.
事件传输对象**必须是可序列化**的,因为将其传输到程外时,它们将被序列化/反序列化为JSON或其他格式.
避免循环引用,多态,私有setter,并提供默认(空)构造函数,如果你有其他的构造函数.(虽然某些序列化器可能会正常工作),就像DTO一样.

@ -48,7 +48,7 @@ public class AngularServiceProxyGenerator : ServiceProxyGeneratorBase<AngularSer
var apiName = args.ApiName ?? defaultValue;
var source = args.Source ?? defaultValue;
var target = args.Target ?? defaultValue;
var url = args.Url ?? "''";
var url = args.Url ?? defaultValue;
var commandBuilder = new StringBuilder("npx ng g @abp/ng.schematics:" + schematicsCommandName);
if (module != null)

@ -7,4 +7,4 @@
"highlight.js": "^9.13.1"
},
"devDependencies": {}
}
}

@ -6,4 +6,4 @@
"@abp/aspnetcore.mvc.ui.theme.basic": "^5.3.0-rc.1",
"@abp/blogging": "^5.3.0-rc.1"
}
}
}

@ -5,4 +5,4 @@
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^5.3.0-rc.1"
}
}
}

@ -5,4 +5,4 @@
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^5.3.0-rc.1"
}
}
}

@ -5,4 +5,4 @@
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^5.3.0-rc.1"
}
}
}

@ -6,4 +6,4 @@
"@abp/aspnetcore.mvc.ui.theme.basic": "^5.3.0-rc.1",
"@abp/cms-kit": "5.3.0-rc.1"
}
}
}

@ -7,7 +7,6 @@ using System.Threading.Tasks;
using MongoDB.Driver;
using MongoDB.Driver.Linq;
using Volo.Abp;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Repositories.MongoDB;
using Volo.Abp.MongoDB;
using Volo.CmsKit.Comments;
@ -23,25 +22,16 @@ public class MongoCommentRepository : MongoDbRepository<ICmsKitMongoDbContext, C
public virtual async Task<CommentWithAuthorQueryResultItem> GetWithAuthorAsync(Guid id, CancellationToken cancellationToken = default)
{
var query = from comment in (await GetMongoQueryableAsync(cancellationToken))
join user in (await GetDbContextAsync(cancellationToken)).CmsUsers on comment.CreatorId equals user.Id
where id == comment.Id
select new {
Comment = comment,
Author = user
};
var commentWithAuthor = await query.FirstOrDefaultAsync(GetCancellationToken(cancellationToken));
if (commentWithAuthor == null)
{
throw new EntityNotFoundException(typeof(Comment), id);
}
var comment = await GetAsync(id);
var author = await (await GetDbContextAsync())
.CmsUsers
.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == comment.CreatorId, GetCancellationToken(cancellationToken));
return new CommentWithAuthorQueryResultItem()
{
Comment = commentWithAuthor.Comment,
Author = commentWithAuthor.Author
Comment = comment,
Author = author
};
}

@ -54,6 +54,15 @@ public abstract class CommentRepository_Tests<TStartupModule> : CmsKitTestBase<T
list.Any(x => x.Author == null).ShouldBeFalse();
}
[Fact]
public async Task GetWithAuthorAsync()
{
var commentDetail = await _commentRepository.GetWithAuthorAsync(_cmsKitTestData.CommentWithChildId);
commentDetail.ShouldNotBeNull();
commentDetail.Author.ShouldNotBeNull();
}
[Fact]
public async Task DeleteWithRepliesAsync()
{

@ -5,4 +5,4 @@
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^5.3.0-rc.1"
}
}
}

@ -5,4 +5,4 @@
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^5.3.0-rc.1"
}
}
}

@ -5,4 +5,4 @@
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "~5.3.0-rc.1"
}
}
}

@ -5,4 +5,4 @@
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "~5.3.0-rc.1"
}
}
}

@ -58,4 +58,4 @@
"ng-packagr": "^13.1.2",
"typescript": "~4.5.4"
}
}
}

@ -5,4 +5,4 @@
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^5.3.0-rc.1"
}
}
}

@ -5,4 +5,4 @@
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^5.3.0-rc.1"
}
}
}

@ -5,4 +5,4 @@
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^5.3.0-rc.1"
}
}
}

@ -5,4 +5,4 @@
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^5.3.0-rc.1"
}
}
}

@ -62,4 +62,4 @@
"symlink-manager": "^1.5.0",
"typescript": "~4.5.4"
}
}
}

@ -5,4 +5,4 @@
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^5.3.0-rc.1"
}
}
}

@ -5,4 +5,4 @@
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^5.3.0-rc.1"
}
}
}

@ -5,4 +5,4 @@
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^5.3.0-rc.1"
}
}
}

Loading…
Cancel
Save