Changing the Name of the Connection String that Entity Framework Uses

前端 未结 1 1993
我寻月下人不归
我寻月下人不归 2021-02-20 04:06

How do you change the name of the connection string that Entity Framework models are bound to by default?

Let\'s say I create an Entity Framework data model named \"Mode

1条回答
  •  [愿得一人]
    2021-02-20 04:48

    The default connection string name is simply the same as the Entity Container Name of your model.

    So if you open up your model, click on a blank area, then go to the Properties window, you can look for the Entity Container Name and change it.

    Note that the Entity Container Name is also used for other things. E.g., it's the class name of your ObjectContext subtype, and it's used when creating EntityKeys.

    0 讨论(0)
提交回复
热议问题