Activities of "oshabani"

we were adding Dapper to our project using this article https://docs.abp.io/en/abp/latest/Dapper

but we face the issue of DependencyResolutionException None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'Sbg.ProjectControl.Locations.LocationsAppService' can be invoked with the available services and parameters: Cannot resolve parameter 0

ABP Framework version: v5.1

  • UI type: MVC

  • DB provider: EF Core

  • Tiered (MVC) or Identity Server Separated (Angular): yes

  • Exception message and stack trace:DependencyResolutionException: None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'Sbg.ProjectControl.Locations.LocationsAppService' can be invoked with the available services and parameters: Cannot resolve parameter 'Sbg.ProjectControl.Locations.ILocationDapperRepository locationDapperRepository' of constructor 'Void .ctor(Sbg.ProjectControl.Locations.ILocationRepository, Volo.Abp.Domain.Repositories.IRepository`2[Sbg.ProjectControl.SubProjects.SubProject,System.Int32], Sbg.ProjectControl.Locations.ILocationDapperRepository)'.

  • Steps to reproduce the issue:

    • Add Volo.Abp.Dapper package to the EntityFramewokCore solution
    • Create a Module class for Dapper :
      • namespace Sbg.ProjectControl.EntityFrameworkCore { [DependsOn(typeof(AbpDapperModule))] public class ProjectControlDapperModule:AbpModule { }
    • create a Dapper repository interface public interface ILocationDapperRepository:IRepository<Location,int>
    • create Dapper repository implement the interface public class DapperLocationRepository : DapperRepository<ProjectControlDbContext>, ITransientDependency, ILocationDapperRepository
    • in the Application service private readonly ILocationDapperRepository _locationDapperRepository;
    • in the constructor i added a parameter to inject the repository
      • public LocationsAppService(ILocationRepository locationRepository, IRepository<SubProject, int> subProjectRepository, ILocationDapperRepository locationDapperRepository)

    that is!

  • we need to know how to fix this issue

Showing 51 to 51 of 51 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11