生成动态api
首先需要继承接口IApplicationService接口。
public interface ILawAppService : IApplicationService
{
//Task<ListResultDto<LawInfoDto>> GetAll();
IQueryable<LawInfoDto> GetAll();
void Create(CreateLawInfoDto input);
}
实现类需要继承接口ILawAppService和类ApplicationService。
public class LawAppService : ApplicationService, ILawAppService
{
private readonly IRepository<LawInfo> _LawInfoRepository;
private readonly ILawRepository _LawRepository;
public LawAppService(ILawRepository lawRepository, IRepository<LawInfo> repository)
{
_LawInfoRepository = repository;
_LawRepository = lawRepository;
}
public void Create(CreateLawInfoDto input)
{
Logger.Info("create a lawinfo for input:" + input);
var lawInfo = ObjectMa

本文介绍了如何在ABP框架下生成动态API,包括继承IApplicationService接口、注册服务及注意事项。同时,讲解了Angular如何调用这些WebAPI,强调了服务命名规则、返回值类型和前端字段命名的细节。

2771

被折叠的 条评论
为什么被折叠?



