When the. NET background uses EF to connect to Oracle, if you do not explicitly specify the schema, you will get an error (the table is not found), which is examined below:
1, tracking Oracle backstage, EF FirstOrDefault, the conversion is ordinary select * from XX WHERE ROWNUM = 1; Copy can be executed but not recognized in EF because schema is not specified
2. You can change the entity table of EF to schema.table this form (not tried)
3, in front of the entity class with the schema, the project is generated through the stored procedure, I added a parameter, used to judge the word is Oracle to generate this form
[Table ("TableName", Schema = "SchemaName")]
4, if you want to dynamically generate schema, you can specify a generic schema in the Dbmodelbuilder, such as: Modelbuilder.hasdefaultschema ("SchemaName"), but only EF6 above can be used
5. EF6 below, specify for each table (can be recycled with reflection), such as:modelbuilder.entity<tablename> (). ToTable ("TableName", "SchemaName");
Oracle Learning Schema under the 27th day EF