sql server - Change Default Name of Relations -


i have 2 tables below structure :

*table user*  id       int      identity username varchar role     varchar   *table ticket*  id       int      identity admin_id int user_id  int 

admin_id , user_id foreign keys user table. set relation name relations in mssql diagram, when create model database, relations : user , user1. when i'm changing them manually, going ok, after refreshing model or re-create ticket table, user , user1 back. how can set final name relations in ef model?even refresh or delete entire model, want ef model relation name being same diagram relation name.

there no way force entity framework names of properties relation names, instead takes table name property name (with integer suffix multiple properties).

now issue, in scenario renamed properties change original names when ever update model database.

we can stop entity framework not reset property names renamed them our own. way is,

  1. open model file (.edmx)
  2. go association folder in model browser
  3. right click on association (which want rename) & go properties
  4. check property pallet, start searching end2 navigation property bottom.
  5. rename whatever want.

that done.

now, not refreshed update model database.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -