I use Ardalis Specifications with Entity Framework. I wrote my app in .NET 7 and I use an onion architecture with mediatr pattern. I have a generic interface IRepository
and I define it as scoped.
When I inject this variable is not null but when I use any method of repository then I got an error
Object reference set not an instance of an object
I created an issue on GitHub repository but Stackoverflow users are much more responsive than GitHub issue checker users, so if you look at it, I will appreciate it.
I didn't pass tenant so if table multitenant and you did not pass tenantId to application, then this error raised. Problem solved when tenantId passed.