This is my application service. I'm i've included the follwing repositories.
public class GroupAppService : IGroupAppService
{
private readonly IGroupRepository _groupRepository;
private readonly UserManager _userManager;
public IAbpSession AbpSession { get; set; }
private IGroupQuizRepository _groupQuizRepository { get; set; }
private IGroupAssignmentRepository _groupAssignmentRepository { get; set; }
Everything works fine until I include
private IPostRepository _groupSocialRepository;
Now whenever I make a call to this application service from dynamic api, the ioc container fails to initialize ALL of the repoistories. everything is null. Urgent help please i've spent a lot of time trying to fix it.
4 Answer(s)
-
0
Hi There,
Are you using EF for data access ? If so there is generic repository that you propably want to use. How do you register your repositories ?
-
0
<cite>Chrisk: </cite> Hi There,
Are you using EF for data access ? If so there is generic repository that you propably want to use. How do you register your repositories ?
Thank you for the quick response! This is my repository interface
public interface IPostRepository : IRepository<Post, Guid > { }
And this is my repository.
public class PostRepoistory : AMSRepositoryBase<Post, Guid>, IPostRepository { public PostRepoistory(IDbContextProvider<AMSDbContext> dbContextProvider) : base(dbContextProvider) { } }
Hope this makes things more clear
-
0
Rename PostRepoistory to PostRepository than it will work.. typing mistake ;)
-
0
<cite>hikalkan: </cite> Rename PostRepoistory to PostRepository than it will work.. typing mistake ;)
Ah, a typo. That's embarrassing :shock: . Thank you for the help guys!