EF database first, rename entity table name

c# entity-framework

Question

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?

1
6
12/26/2013 6:52:09 AM

Accepted Answer

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.

15
12/26/2013 7:14:08 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