Ouvert Fermé

Dapper Integration #6360


User avatar
0
icoretchi créé
  • ABP Framework version: v7.4.2
  • UI Type: Blazor WASM
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes/no
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

Hi,

I have the same isssue as https://support.abp.io/QA/Questions/2745/How-to-add-Dapper-to-existing-porject. How did you solve it?

Thanks.


4 Réponse (s)
  • User Avatar
    0
    liangshiwei créé
    Équipe d'assistance Fullstack Developer

    Hi,

    You can check the unit tests: https://github.com/abpframework/abp/blob/dev/framework/test/Volo.Abp.Dapper.Tests/Volo/Abp/Dapper/Repositories/PersonDapperRepository_Tests.cs#L14

  • User Avatar
    0
    icoretchi créé

    Hi,

    The tests don't show how you resolved the issue. Allow me to remind you that the problem was that the implementation of the Dapper interface wasn't properly descoved by dependency injection. I succeeded to resolve the issue by mannually register the interface and implementation. I've just wondering how you have solved the issue.

    Cheers, Yulian

  • User Avatar
    0
    liangshiwei créé
    Équipe d'assistance Fullstack Developer

    Hi,

    This may be a naming convention issue,

    When one implements multiple interfaces, ABP doesn't know which one to register, So ABP uses the naming convention.

    For example:

    public interface IDapperBookRepository
    {
        
    }
    
    
    public class DapperBookRepository: DapperRepository<xxx>, IDapperBookRepository, ITransientDependency
    {
        
    }
    
  • User Avatar
    0
    icoretchi créé

    Ok. I've understood.

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