Starts in:
2 DAYS
16 HRS
48 MIN
12 SEC
Starts in:
2 D
16 H
48 M
12 S
Open Closed

abp generate-proxy fails to create proxy classes correctly when service interface inherits a custom base interface. #8151


User avatar
0
mgurer created
  • ABP Framework version: v8.3.1
  • UI Type: Blazor Server
  • Database System: EF Core (PostgreSQL, etc..)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes/
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

Hello

I am experiencing a strange behaviour when using abp generate-proxy cli command.

Below there is a few lines of codes;

//towns service contract public interface ITownsAppService : ICrudAppService<TownDto, Guid, GetTownsInput, TownCreateDto, TownUpdateDto>, ILookupService { }

//my lookup service interface public interface ILookupService { Task<PagedResultDto<LookupDto<Guid>>> GetListAsLookupAsync(LookupRequestDto input); }

//towns service implementation public class TownsAppService : CrudAppService<Town, TownDto, Guid, GetTownsInput, TownCreateDto, TownUpdateDto>, ITownsAppService {...}

//towns service controller [RemoteService(Name = MasterServiceRemoteServiceConsts.RemoteServiceName)] [Area("master-service")] [ControllerName("Town API")] [ApiVersion("1.0")] [Route("api/master-service/towns")] public class TownController : AbpController, ITownsAppService {...}

when i run the following command; abp generate-proxy -t csharp -u https://localhost:xxx/ -m master-service --without-contracts

Proxy codes are generated for ILookupsService not for ITownsAppService, as you can see my controller and my service implemtation inherits ITownsAppService directly and ILookupService indirectly.

[Dependency(ReplaceServices = true)] [ExposeServices(typeof(ILookupService), typeof(TownClientProxy))] public partial class TownClientProxy : ClientProxyBase<ILookupService>, ILookupService

So when i try to access ITownsAppService, i got interface not implemented error as you can figure out.

If I rename ILookupService to ILookupAdaptor, proxy generation skips to generate proxy files for towns. No output created.

Is there a way to fix this issue?

Murat Gürer


3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you create two implementation classes and controllers for these two interfaces?

    The generate-proxy command only supports the standard abp code style.

    In other words, it cannot recognize the situation of multiple interfaces and one implementation class.

    Thanks.

  • User Avatar
    0
    mgurer created

    Hi again. I don’t prefer to implement two seperate implementations and controllers. This really makes no sense. You take serious amount of power off from our hands with this limitation. What is left in the language if you exclude the inheritence and polimorphism. Too disappointed.

    Thanks anyway

  • User Avatar
    0
    mgurer created

    I also want to add this line; if I knew that polymorhism is blocked by Abp’s design choice, I would never, ever start using abp. I wish I knew at the beginning. I was actively advocating the framework to my network for their sake of good, now I understand that I mistakenly lead them to into a nightmare. Sorry for them. My bad.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06