EF Core generated sql query is using the entity name as table name, not the custom table name set by the table naming convention


I have a custom table naming convention which prefixes B_ to the entity name. This works fine when I generate the migration scripts. However, when I execute any get method, the EF Core generated code doesn't generate the table name with the prefix. Instead it uses the Entity name itself as table name and due to this, an exception - *

Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid object name 'Appointment'

*.- is thrown. The query is supposed to be generated with table name as B_Appointments, which is the custom table name.

Do anyone have any idea, why this is happening?

asked on Stack Overflow Nov 23, 2020 by Vishnu

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0