在你阅读this post之前,要知道我已经看过这篇文章了……问题几乎是一样的,我已经尝试过这个解决方案。所以这篇文章不是重复的。
我们使用了ASP.NET样板启动模板。我们已经开发了一些应用程序服务,它们的结构如下:
public interface IFooAppService :
IAsyncCrudAppService<FooDto, Guid, GetAllFooDto, CreateFooDto, UpdateFooDto>
// Abp.Application.Services.IAsyncCrudAppService<...>
{
}
[AbpAuthorize("Authorize.Foo")]
public class FooAppService :
AsyncCrudAppService<Foo, FooDto, Guid, FooFilterInput, CreateFooDto, FooDto>,
IFooAppService
{
private readonly BarManager _barManager;
public FooAppService(IBarManager barManager, IRepository<Foo, Guid> repository)
: base (repository)
{
_barManager = barManager;
}
public override async Task<FooDto> Create(CreateFooDto input)
{
// create with repository
}
// other overridden Actions and Foo interface implementation
}
所有内容都与可用的here文档一致。
所有的方法都工作得很好,我可以使用Swagger的所有功能。配置似乎还可以(我们为ABP注入了一些后JavaScript,...)等等。
最初,我有以下版本:
Microsoft.AspNetCore
:2.0.1Microsoft.EntityFrameworkCore
:2.0.1Abp.AspNetCore
:3.6.2Swashbuckle.AspNetCore
:1.1.0我们有385 API。
我添加了一个新的AppService、承诺,以及它的经理、Dtos等。
这时,当我启动并大摇大摆时,我的浏览器崩溃了,并显示一条消息,询问我是否要停止脚本(IE,Edge,Firefox,Chrome,...)。
在调试模式下,我没有关于可能抛出的异常的信息。
已尝试:
Swashbuckle.AspNetCore
NuGet软件包(所有版本: 1.2、2.X和3.0.0)- In version 1.X, I've the same problem.
- In version 2.5, UI doesn't displayed.
- In other versions, UI is displayed, I can use all methods EXCEPT my new methods, Commitment. When I click hover him, I've only the spinner... Browser freezes and ask me if I want to stop the script or wait.
在Chrome上,Chrome引发错误:
以防我的代码在被覆盖的方法中出错。
[AbpAuthorize("Authorize.Commitments")]
public class CommitmentAppService :
AsyncCrudAppService<Commitment, CommitmentDto, Guid, CommitmentFilterInput, CreateCommitmentDto, UpdateCommitmentDto>,
ICommitmentAppService
{
private readonly ICommitmentManager _commitmentManager;
private readonly IFundManager _fooManager;
private readonly ILimitedPartnerManager _barManager;
public CommitmentAppService(
ICommitmentManager commitmentManager,
IFooManager fooManager,
IBarManager barManager,
IOneRepository<Commitment, Guid> repository)
: base(repository)
{
_commitmentManager = commitmentManager;
_fooManager = fooManager;
_barManager = barManager;
_commitmentManager = commitmentManager;
}
// nothing here
}
同样的结果。
仅
- `AsyncCrudAppService<Commitment, CommitmentDto, Guid>` where are defined the Entity, its DTO and PK type
- `AsyncCrudAppService<Commitment, CommitmentDto, Guid, CommitmentFilterInput>` where are defined the Entity, its default DTO, PK type, and Filter Input DTO
- `AsyncCrudAppService<Commitment, CommitmentDto, Guid, CommitmentFilterInput, CommitmentDto>` where are defined the Entity, its default DTO, PK type, Filter Input DTO and Creation Entity DTO
- `AsyncCrudAppService<Commitment, CommitmentDto, Guid, CommitmentFilterInput, CommitmentDto, CommitmentDto>` where are defined the Entity, its default DTO, PK type, Filter Input DTO, Creation Entity DTO and Update Entity DTO
同样的结果。
- `AsyncCrudAppService<Commitment, CommitmentDto, Guid>`where are defined the Entity, its DTO and PK type
- `AsyncCrudAppService<Commitment, CommitmentDto, Guid, CommitmentFilterInput>` where are defined the Entity, its default DTO, PK type, and Filter Input DTO
- `AsyncCrudAppService<Commitment, CommitmentDto, Guid, CommitmentFilterInput, CreateCommitmentDto>` where are defined the Entity, its default DTO, PK type, Filter Input DTO and Creation Entity DTO
- `AsyncCrudAppService<Commitment, CommitmentDto, Guid, CommitmentFilterInput, CreateCommitmentDto, UpdateCommitmentDto>` where are defined the Entity, its default DTO, PK type, Filter Input DTO, Creation Entity DTO and Update Entity DTO
同样的结果。
validate的
Swagger (OpenApi,我知道...)在https://editor.swagger.io/提供了一个在线编辑器
我复制了swagger.json并将其粘贴到编辑器中。我有一些关于语义的错误(我认为这是由于从Json到Yaml的转换造成的)。
paths./api/services/app/Foo/GetAll.get.responses.200.schema.$ref RFC3986值处的
语义错误必须是符合百分比编码的URI跳到第234行
无法解决paths./api/services/app/Foo/GetAll.get.security.0.0安全作用域定义Funds.BankAccounts处的语义错误跳至第240行
对于CommitmentAppService,我没有特殊的错误。我可以展开除承诺方法之外的所有项目...浏览器崩溃,诸如此类
public CommitmentAppService(IRepository<Commitment, Guid> repository)
: base(repository)
{ /**/ }
不..。
如果有人有解决方案..。
发布于 2018-10-11 07:49:34
都是我不好!
我需要添加承诺和它的Dtos代码,以了解我在哪里犯了错误……
[Table("Commitment")]
public class Commitment : FullAuditedEntity<Guid>,
{
public string Property1 { get; set; }
public Foo Foo { get; set; }
public Guid FooId { get; set; }
}
[AutoMapFrom(typeof(Commitment))]
[AutoMapTo(typeof(Commitment), MemberList = AutoMapper.MemberList.Source)]
public class CommitmentDto : EntityDto<Guid>
{
public string Property1 { get; set; }
public Foo Foo { get; set; }
public Guid FooId { get; set; }
}
我在CommitmentDto中使用了 entity objects而不是Dtos...实际上,我需要在CommitmentDto
中使用FooDto
(而不是Foo
)。
https://stackoverflow.com/questions/52725643
复制相似问题