Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EF database first, rename entity table name

I have project with approach database first. Tables this database have names kind GUID. I want use human names in code. How i can change name entity, but no change table name in database?

like image 551
user3135932 Avatar asked Dec 26 '13 06:12

user3135932


1 Answers

You can do that using EF Model Browser:

  • Open Entity Model Browser
  • Navigate to your entity under YourModel/Entity Types
  • right click + Properties
  • You can chance entity type name here

Or using designer:

  • right click on your entity on the design pane + Properties from context menu
  • Change Name property value

It will change generated entity class name without changing the database table nama.

like image 60
MarcinJuraszek Avatar answered Oct 11 '22 05:10

MarcinJuraszek