Open Closed

Dapper Integration #6360


User avatar
0
icoretchi created
  • 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 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team 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 created

    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 created
    Support Team 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 created

    Ok. I've understood.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 05, 2024, 12:19