Share via

Getting error when running repository test after upgrading to .Net 6.0 from .Net Core 3.1 and EF Core 6 from EF Core 3.1 with a stored procedure

bsr7 1 Reputation point
2022-02-15T16:32:59.913+00:00

Message: 
System.NullReferenceException : Object reference not set to an instance of an object.

Stack Trace: 
RelationalDatabaseFacadeExtensions.ExecuteSqlRawAsync(DatabaseFacade databaseFacade, String sql, IEnumerable`1 parameters, CancellationToken cancellationToken)
AuRepository.HasPermissionAsync(AppSession appSession, AppPermission permEntity) line 107
AuRepositoryTest.HasPermissionAsync() line 116
--- End of stack trace from previous location ---

Getting error when running repository test after upgrading to .Net 6.0 from .Net Core 3.1 and EF Core 6 from EF Core 3.1 with a stored procedure returning an int value. There is a service test that passes but the repository test is failing. Could you please advise on what could be going wrong with respect to repository test. Staying on EF Core 3.1 is not a solution as more unit tests failed for which the fix was to upgrade to EF Core 6

Developer technologies | .NET | Entity Framework Core

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.