0

So I am using ASP.NET Core 5, MySql, and Entity Framework in my project. Every class in my back end is Camel case, but when I create my database, all entities are lowercase. I would like to keep the Camil case in the database too. How do I do that?

Also, when scaffolding a MySql database (again ASP.NET Core 5 and Entity Framework and MySql, using the Package manager console) something similar happens - It generates classes, but only the first word is upper case, I want Camel case.

Thanks in advance.

Update: changing the lower_case_table_names property in my.ini file to any option - 0, 1 or 2 dors not change the files, they remain lowercase.

  • [Identifier Case Sensitivity](https://dev.mysql.com/doc/refman/8.0/en/identifier-case-sensitivity.html), [`@@lower_case_table_names` system variable](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_lower_case_table_names). Use 0 or 2, depends on OS and FS. But if the framework/library alters the letters case and this cannot be adjusted by some setting - you can do nothing. – Akina Aug 11 '21 at 12:14
  • I tried with both 0 and 2, in the database the tables are lowercase, when scaffolding already existing database the names of the tables are not CamilCase too, but the strangest thing is that the properties genrated are.. – YoannaKostova Aug 11 '21 at 12:17
  • *in the database the tables are lowercase* Check tables files names - are they in lowercase? Enable General Log, create some table with CamelCase and check the query text sent to MySQL from the client - does the name provided in SQL text is CamelCase? – Akina Aug 11 '21 at 12:24
  • I tried that, even though I make the table with some uppercase letters, the database ignores it – YoannaKostova Aug 11 '21 at 12:34
  • I.e. in General Log the tablename is CamelCase whereas ondisk file is lowercase? – Akina Aug 11 '21 at 12:38

1 Answers1

0

Here is how I managed to fix my issue: during the installation of MySql, there is an option for choosing the setup you need when it comes to case sensitivity: enter image description here

Here is a reference to the post I found my solution: Can't set lower_case_table_names in MySQL 8.x on Windows 10