Open Closed

Custom Controller creating 2 end points #1076


User avatar
0
lalitChougule created
  • ABP Framework version: v3.0.4
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no / yes
  • Exception message and stack trace: N.A
  • Steps to reproduce the issue: N.A

Controller.cs

using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using SCV.Litmus.LitmusUsers;
using Volo.Abp;

namespace SCV.Litmus.Controllers.LitmusUsers
{
    [RemoteService]
    [Route("api/ApplicationManagement/litmusUser")]
    public class LitmusUserController : LitmusController, ILitmusUserAppService
    {
        private readonly ILitmusUserAppService _litmusUserAppService;

        public LitmusUserController(ILitmusUserAppService litmusUserAppService)
        {
            _litmusUserAppService = litmusUserAppService;
        }

        [HttpPost]
        public virtual Task<LitmusUserOutputDto> CreateAsync(LitmusUserCreateDto input)
        {
            return _litmusUserAppService.CreateAsync(input);
        }
    }
}


My swagger is showing 2 end points

Two end point which are as below :

  1. /api/ApplicationManagement/litmusUser/createUser -- My custom route
  2. /api/app/litmusUser -- Auto generated

I just want my controller to create 1 route which is 1st /api/ApplicationManagement/litmusUser/createUser


2 Answer(s)
  • User Avatar
    0
    alper created
    Support Team Director

    I think there's also another method for your second "auto generated" action in LitmusUserAppService. You can disable your application service so that it doesn't expose its methods as WebAPI

    [RemoteService(false)]
    public class LitmusUserAppService : ApplicationService
    {
    
    }
    
    
  • User Avatar
    0
    ServiceBot created
    Support Team Automatic process manager

    This question has been automatically marked as stale because it has not had recent activity.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11