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 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.
-
If I understood question correctly OP wants to use
string
s containing human defined names and keepuniqueidentifier
as type of sql field.– LeriDec 26, 2013 at 7:11 -
in database tableName = dvtable_5b607ffc_7ea2_47b1_90d4_bb72a0fe7280, in db.Context i want use tableName = Persons instead dvtable_5b607ffc_7ea2_47b1_90d4_bb72a0fe7280 Dec 26, 2013 at 7:33
-
is it possible to change table name after compiled? or is it possible to make the table name to read from an Appsettings from .config file?– RollRollFeb 5, 2018 at 15:35