I have created a database using Entity Framework code first approach, and now I am trying to verify the relations of data tables but unfortunately after wasting 2 days still unable to get any solution.
You might try to use Entity Framework Power Tools that is a Visual Studio
add-in that was used to create the data model diagrams shown in these tutorials. The tools can also do other function such as generate entity classes based on the tables in an existing database so that you can use the database with Code First
. After you install the tools, some additional options appear in context menus. For example, when you right-click your context class in Solution Explorer
, you get an option to generate a diagram. When you're using Code First
you can't change the data model in the diagram, but you can move things around to make it easier to understand.
According to this article the following query solves the problem.
alter authorization on database::[your-db-name-no-quotes] to sa
I tried it and it worked for me.
You might try to use Entity Framework Power Tools that is a Visual Studio
add-in that was used to create the data model diagrams shown in these tutorials. The tools can also do other function such as generate entity classes based on the tables in an existing database so that you can use the database with Code First
. After you install the tools, some additional options appear in context menus. For example, when you right-click your context class in Solution Explorer
, you get an option to generate a diagram. When you're using Code First
you can't change the data model in the diagram, but you can move things around to make it easier to understand.
There is a possibility to create a diagram from an existing database. You could use SQL Server Management Studio Express diagram generator. Right-click in diagrams folder in the database and choose create a new diagram. Please also refer to this answer: Generate table relationship diagram from existing schema (SQL Server)
© 2022 - 2024 — McMap. All rights reserved.