timabell / ef-enum-to-lookup

Generates lookup tables from enum references in Microsoft Entity Framework 6.1
https://www.nuget.org/packages/ef-enum-to-lookup
69 stars 29 forks source link

Postfix and suffix for foreign key column #48

Closed gijsdeboer closed 8 years ago

gijsdeboer commented 8 years ago

The foreign key columns that are created by EnumToLookup don't get the 'Id' suffix that I do get when I create a regular EF relationship property.

I can fix this issue by adding the Column attribute on every enum for instance: [Column("TaxTypeId")] public TaxType TaxType { get; set; }

It would be nice if I could set a ForeignKey prefix and suffix once that would be added to every Foreign Key column EnumToLookup created. That way, if I would set a TableNameSuffix "Enum" and a ForeignKeySuffix "EnumId", I would get a foreign key column TaxTypeEnumId that would follow my convention .

timabell commented 8 years ago

It's EF creating the column not this library. This library only adds the FK to the existing columns.