我正在阅读关于 abp.io 的教程:
https ://docs.abp.io/en/abp/latest/Tutorials/Part-1?UI=MVC#create-the-application-service
我创建了服务:
using Abp.Application.Services;
public interface IBookAppService :
ICrudAppService< //Defines CRUD methods
BookDTO , //Used to show books
Guid, //Primary key of the book entity
PagedAndSortedResultRequestDto, //Used for paging/sorting on getting a list of books
CreateUpdateBookDto, //Used to create a new book
CreateUpdateBookDto> //Used to update a book
{
}
但是界面显示错误:
类型“
BookDTO
”不能用作TEntityDto
泛型类型或方法“ ”中的类型参数“ICrudAppService<TEntityDto, TPrimaryKey, TGetAllInput, TCreateInput, TUpdateInput>
”。没有从 'BookDTO
' 到 'Abp.Application.Services.Dto.IEntityDto<System.Guid>
' 的隐式引用转换。
BookDTO
如下:
using Volo.Abp.Application.Dtos;
public class BookDTO : AuditedEntityDto<Guid>
{
public string Name { get; set; }
public BookType Type { get; set; }
public DateTime PublishDate { get; set; }
public float Price { get; set; }
}