question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Swagger UI won't create/show AppService

See original GitHub issue

I have downloaded a new project ABP V 4.8.0 with Angular for .Net 2.x.

In my Core project I have

        [Table("eDocuments")]
        public class eDocument : Entity, IFullAudited
        {
             public string DocumentName { get; set; }
             public string DocumentPath { get; set; }
         }

Then I added the entity to DBContext, Added migration, and updated my database

public DbSet<eDocument> eDocuments { get; set; } 

I went to the Application Layer and Created Interface IeDocumentAppService

 public interface IeDocumentAppService : IApplicationService
    {
        Task<ListResultDto<eDocumentListDto>> GetAllDocuments();
    }

I also created eDocumentAppService


    class eDocumentAppService : DocManagerAppServiceBase, IeDocumentAppService
    {
        private readonly IRepository<eDocument> _eDocumentRepository;

        public eDocumentAppService(IRepository<eDocument> eDocumentRepository)
        {
            _eDocumentRepository = eDocumentRepository;
        }
        public async Task<ListResultDto<eDocumentListDto>> GetAllDocuments()
        {
            var _edoc = await _eDocumentRepository
                .GetAll()
                .OrderByDescending(t => t.CreationTime)
                .ToListAsync();

            return new ListResultDto<eDocumentListDto>(
                ObjectMapper.Map<List<eDocumentListDto>>(_edoc));
        }
    }

And lastly eDocumentListDto


         [AutoMapFrom(typeof(eDocument))]
         public class eDocumentListDto : EntityDto, IFullAudited
         {
          public string DocumentName { get; set; }

          public string DocumentPath { get; set; }
          }

When I run the project everything builds and I get to the Swagger UI. However, I do not see the endpoint on Swagger. What am I not seeing

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
malimingcommented, Jan 30, 2020

Try

[AutoMap(typeof(eDocument))]
public class CreateDocumentDto : AuditedEntityDto
{
    public string DocumentName { get; set; }

    public string DocumentPath { get; set; }

}

I suggest you check the documentation. https://aspnetboilerplate.com/Pages/Documents/Object-To-Object-Mapping

2reactions
malimingcommented, Jan 30, 2020

Please make eDocumentAppService class public.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DotNet 5.0 Swagger is not loading in Azure App Service
i have a web api which is created using dotnet 5.0 and deployed to Azure App Service, It is running and swagger loads...
Read more >
Failed to load Swagger API definition for a Newly ...
I just pushed a .NET Core 6.0 WebAPI to Azure AppService. When I access the location I receive the following error issued when...
Read more >
Secure Open API (Swagger) calls with Azure Active Directory
So, I decided to open the Swagger UI page in an Incognito tab using port 5001 (the one that was breaking the authentication)....
Read more >
Help! My swagger controllers all return a 404 in .NET 6
Else your application won't be able to route your urls to the correct controllers and you will get a 404 not found for...
Read more >
Testing Azure AD-protected APIs, part 1: Swagger UI
In the first part in this series, we will look at how to setup Swagger UI so it can be used to test...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found