Open Closed

ABP SUITE 2.9.0 new entity creation fails and migration breaks with incorrect code! #272


User avatar
0
pkouame created
  • ABP Framework version: v2.9.0
  • UI type: Angular / MVC
  • Tiered (MVC) or Identity Server Seperated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:

all my primary keys are int and suite generates server lookupasync() code based on guid. Eventually prevents migrations (and database update)

Task<PagedResultDto<LookupDto<guid?>>> instead of Task<PagedResultDto<LookupDto<int?>>> in one of server controllers

very reproducible


6 Answer(s)
  • User Avatar
    0
    pkouame created

    steps to reproduce:

    • create an entity Vendor with a int primary key
    • create an VendorTest with a navigation property to Vendor

    Controllers/VendorTests/VendorTestController.cs(16,56): error CS0738: 'VendorTestController' does not implement interface member 'IVendorTestAppService.GetVendorLookupAsync(LookupRequestDto)'. 'VendorTestController.GetVendorLookupAsync(LookupRequestDto)' cannot implement 'IVendorTestAppService.GetVendorLookupAsync(LookupRequestDto)' because it does not have the matching return type of 'Task<PagedResultDto<LookupDto<int?>>>'. [/Users/me/dev/aqua/abp-pro/v290/skipjack/Skipj.Track/aspnet-core/src/Skipj.Track.HttpApi/Skipj.Track.HttpApi.csproj] 0 Warning(s) 1 Error(s)

    as you can see below ... in visual studio code VendorTestController.cs returns:

    [HttpGet] [Route("vendor-lookup")] public Task<PagedResultDto<LookupDto<Guid?>>> GetVendorLookupAsync(LookupRequestDto input) { return _vendorTestAppService.GetVendorLookupAsync(input); }

        when it should be Task&lt;PagedResultDto&lt;LookupDto&lt;int?&gt;>
        
        
    

    Please help - this is a showstopper

    abp v2.9.0 abp suite v2.9.0 brand new solution created with 2.9 already re-installed abp suite from scratch

  • User Avatar
    0
    pkouame created

    Anybody there?

    Ok - looks like this is another Template Error (arghhhh) - there were two consequences

    1- build error and migration interrruption 2- bad api name

    [Route("%%np-entity-name-camelcase%%Lookup")] instead of

    [Route("%%np-entity-name-camelcase%%-lookup")]

    not sure what the intent was - here's my edit:

    ALSO - what is this in my template folder and how can I fix it :

  • User Avatar
    0
    pkouame created

    Did I assume correctly that the api should be called %%np-entity-name-camelcase%% Lookup instead of %%np-entity-name-camelcase%%-lookup? What is your naming convention?

    My template fix works but I want to make sure before I used it across my other tables...

    Also - how to get rid of that garballed template above (would you know how that happened?)

  • User Avatar
    0
    alper created
    Support Team Director

    @pkouame , we are checking the issue now.

  • User Avatar
    0
    alper created
    Support Team Director

    The issue has been fixed in v3.0.3 ( this version will be released in 2020-07-08)

    it's not a show stopper. you just need to manually change Guid? to int? in VendorTestController.cs that's all.

  • User Avatar
    0
    pkouame created

    Ok - just to be clear

    • you are reporting that the "vendorLookup" versus "vendor-lookup" route naming issue has been fixed in 3.0.3 and the convention is %%np-entity-name-camelcase%%-lookup. At the time this was reported the server route name was still "vendorLookup"
    • I didn't experience the second primary key issue you mentioned. But I'll assume that has been fixed also.

    Thank yoiu

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38