Author : HASSAN MD TAREQ

Prepare Database

See: setup database

Connect Database to SQL Server Object Explorer

SQL Server Developer Edition

  • SQL Server Developer Edition is running locally
  • AdventureWorks sample Database is imported using SSMS (previous step: Prepare database)
  • Get the connection string from SSMS
  • Visual Studio > SQL Server Object Explorer > connect Database using that connection string

Azure SQL

If private endpoint is created for Azure sql server i.e. 10.22.333.55 foo-test.database.windows.net

  • Open Notepad as Admin
  • Notepad menu > FIle > Open > C:\Windows\System32\drivers\etc > hosts file
  • Add that : 10.22.333.55 foo-test.database.windows.net
  • Save
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#


# localhost name resolution is handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost
10.22.333.55 foo-test.database.windows.net

Now get the Azure SQL connection string and:

SQL Server Object Explorer - connecting to Azure SQL

Ensure EF Core Power Tools

  • We are gonna use .Net core 3.1+
  • In roder to use .Net core 3.1+, we have to use Visual Studio 2019+

Step-1

Installing Entity Framework Core Power Tools Step 1

Step-2

Installing Entity Framework Core Power Tools Step 2

Step-3

Installing Entity Framework Core Power Tools Step 3