I am trying to connect to SQL Server in a .NET Core 3 library, for implementation this ORM I use "Database First Scaffold-DbContext" command like this:
Scaffold-DbContext "Server=IP/sql2016;Initial Catalog=DatabaseName;
Persist Security Info=True; User ID=UserName; Password=Password;
MultipleActiveResultSets=False; Encrypt=True; TrustServerCertificate=True;
Connection Timeout=30;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir
Models -Force
If I use this command with IP server, it just creates DbContext and does not create table models. If I replace the server IP with local (when restore database backup to my local database) it creates all data models.
I don't know what should I do?
Another question: when I create a data model, does it not assign primary key to my model?