I want inject unitOfWork
to class providerToken .
But my code gives a runtime error and the application stops
Someone can help me
public class TokenProvider : PhoneNumberTokenProvider<ApplicationUser>
{
public static string Phone = "Phone";
public static string Email = "Email";
private readonly IUnitOfWork _unitOfWork;
public TokenProvider(IUnitOfWork unitOfWork)
{
this._unitOfWork = unitOfWork;
}
}
Error
'iisexpress.exe' (CoreCLR: DefaultDomain): Loaded 'C:Program FilesdotnetsharedMicrosoft.NETCore.App5.0.2System.Private.CoreLib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'G:ProjectMicroServices-IdentityIdentityMicroserviceAPIinDebug et5.0API.dll'. Symbols loaded. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.NETCore.App5.0.2System.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.AspNetCore.App5.0.2Microsoft.AspNetCore.Server.IIS.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.AspNetCore.App5.0.2Microsoft.AspNetCore.Hosting.Abstractions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.AspNetCore.App5.0.2Microsoft.AspNetCore.Hosting.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.AspNetCore.App5.0.2Microsoft.AspNetCore.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.AspNetCore.App5.0.2Microsoft.Extensions.Configuration.Abstractions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.AspNetCore.App5.0.2Microsoft.Extensions.DependencyInjection.Abstractions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.AspNetCore.App5.0.2Microsoft.Extensions.DependencyInjection.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.AspNetCore.App5.0.2Microsoft.Extensions.Logging.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.AspNetCore.App5.0.2Microsoft.Extensions.Configuration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.NETCore.App5.0.2 etstandard.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:Program FilesdotnetsharedMicrosoft.AspNetCore.App5.0.2Microsoft.Extensions.Hosting.Abstractions.dll'. FilesdotnetsharedMicrosoft.NETCore.App5.0.2System.Transactions.Local.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request starting HTTP/1.1 GET http://localhost:1282/swagger/v1/swagger.json - - Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request finished HTTP/1.1 GET http://localhost:1282/swagger/v1/swagger.json - - - 200 - application/json;charset=utf-8 187.3716ms The program '[29676] iisexpress.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'. The program '[29676] iisexpress.exe: Program Trace' has exited with code 0 (0x0).
question from:https://stackoverflow.com/questions/65943063/how-using-unitofwork-in-tokeprovider