EF code first migrations from Pascal Case Properties to lower case columns

.net ef-code-first ef-code-first-mapping ef-migrations entity-framework-6

Question

Is it possible to have Entity Framework 6 Code First produce a database with lower case column names even while my model classes have Pascal Casing properties? Perhaps this can be done using Data Annotations or Fluent API.

Meaning this class:

 public class Person
    {
        public int PersonId { get; set; }
        public string FirstName { get; set; }
        public string Surname { get; set; }
}

should be mapped to this table (i.e., this table should be produced by migrations):

person
    person
    firstname
    surname

or perhaps something similar to this:

person
    person_id
    first_name
    surname

PS: I'm using a MySQL database right now. Thanks

1
2
2/7/2017 7:43:56 AM

Popular Answer

ZZZ_tmp
0
10/10/2018 1:39:52 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow