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: https://1drv.ms/u/s!AjZf_PiMM9Arg6QLX9dfqkqu_Piepw
Solution: https://1drv.ms/u/s!AjZf_PiMM9Arg6QKrT3AuP3QTJaQYQ?e=5lLU97
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,
to
"LockoutEnd" TIMESTAMP (3) WITH TIME ZONE,