Oracle DB record accessible once only using NetFrameworkCore for Oracle entity-framework-core oracle usermanager


I have a simple web solution (incomplete) using NetFrameworkCore for Oracle.

See HomeController.CS & AspNetUser.CS -->

The issue is I have an AspNetUser record that was created in DB via Microsoft.AspNetCore.Identity.UserManager. This record is accessible by finding by ID, managed to retrieve record.

However, on stopping the solution and doing a re-run (without creating new AspNetUser), I cannot retrieve the record via the ID. Instead, a 500 error with invalid cast exception on Oracle.ManagedDataAccess.Client.OracleDataReader.GetDateTimeOffset() is thrown. The issue may not be table column related as re-creating the table allows the record to be accessible again albeit once as well.

What could be the issue then? I apologize as I am new to Oracle and net core web. Below are the links to the error and web solution.

Error 500:!AjZf_PiMM9Arg6QLX9dfqkqu_Piepw


3/20/2020 9:10:14 AM

Popular Answer

I have managed to resolve the issue of InvalidCastException. The current Oracle table was created manually without using EntityFrameworkCore tool.

After dropping the table and re-creating using the commands "add-migration " & "update-database", the table is accessible on subsequent reads.

The issue was with the column, LockoutEnd.

Changed from

"LockoutEnd" TIMESTAMP(7) NULL,


3/23/2020 2:59:26 AM

Related Questions


Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow