Browse Source

Update Application-Services.md

pull/2109/head
maliming 7 years ago
committed by GitHub
parent
commit
c8da014794
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      docs/zh-Hans/Application-Services.md

16
docs/zh-Hans/Application-Services.md

@ -200,15 +200,15 @@ public async Task<BookDto> GetAsync(Guid id)
### CRUD应用服务 ### CRUD应用服务
如果需要创建具有Create,Update,Delete和Get方法的简单CRUD应用服务,则可以使用ABP的基类轻松构建服务. 你可以继承CrudAppService或 AsyncCrudAppService. 如果需要创建具有Create,Update,Delete和Get方法的简单CRUD应用服务,则可以使用ABP的基类轻松构建服务. 你可以继承CrudAppService.
示例: 示例:
创建继承`IAsyncCrudAppService`接口的`IBookAppService`接口. 创建继承`ICrudAppService`接口的`IBookAppService`接口.
````csharp ````csharp
public interface IBookAppService : public interface IBookAppService :
IAsyncCrudAppService< //Defines CRUD methods ICrudAppService< //Defines CRUD methods
BookDto, //Used to show books BookDto, //Used to show books
Guid, //Primary key of the book entity Guid, //Primary key of the book entity
PagedAndSortedResultRequestDto, //Used for paging/sorting on getting a list of books PagedAndSortedResultRequestDto, //Used for paging/sorting on getting a list of books
@ -218,12 +218,12 @@ public interface IBookAppService :
} }
```` ````
* IAsyncCrudAppService有泛型参数来获取实体的主键类型和CRUD操作的DTO类型(它不获取实体类型,因为实体类型未向客户端公开使用此接口). * ICrudAppService有泛型参数来获取实体的主键类型和CRUD操作的DTO类型(它不获取实体类型,因为实体类型未向客户端公开使用此接口).
`IAsyncCrudAppService`声明以下方法: `ICrudAppService`声明以下方法:
````csharp ````csharp
public interface IAsyncCrudAppService< public interface ICrudAppService<
TEntityDto, TEntityDto,
in TKey, in TKey,
in TGetListInput, in TGetListInput,
@ -278,7 +278,7 @@ public class CreateUpdateBookDto
````csharp ````csharp
public class BookAppService : public class BookAppService :
AsyncCrudAppService<Book, BookDto, Guid, PagedAndSortedResultRequestDto, CrudAppService<Book, BookDto, Guid, PagedAndSortedResultRequestDto,
CreateUpdateBookDto, CreateUpdateBookDto>, CreateUpdateBookDto, CreateUpdateBookDto>,
IBookAppService IBookAppService
{ {
@ -289,7 +289,7 @@ public class BookAppService :
} }
```` ````
`AsyncCrudAppService`实现了`IAsyncCrudAppService`接口中声明的所有方法. 然后,你可以添加自己的自定义方法或覆盖和自定义实现. `CrudAppService`实现了`ICrudAppService`接口中声明的所有方法. 然后,你可以添加自己的自定义方法或覆盖和自定义实现.
### 生命周期 ### 生命周期

Loading…
Cancel
Save