Search code examples
c#entity-frameworkentity-framework-coreoracle11g

Oracle.ManagedDataAccess.Client.OracleException : ORA-00904: invalid identifier


When running the code generated by EntityFramework's scaffolding, i ran into this error:

Oracle.ManagedDataAccess.Client.OracleException : ORA-00904: "p0"."ModifiedByNavigationUuid": invalid identifier

Yes, the EntityFramework seems to be concatenating the "navigation" property and the id of the associating object together.


Solution

  • Ultimately, this is caused by EntityFramework's inability to distinguish the name of the property and the name of the class.

    Example: I have a class named ProductLine and I also have a class named Product. Product holds a "reference" to ProductLine as Guid. This will trigger the Oracle error.

    private Guid ProductLine;
    

    Solution: Rename the referencing property.

    private Guid ProduceLineId;