Basic CRUD App based on the tutorial in this link but with some modifications particularly on querying and displaying a one-to-many relationship between two resources. For this sample app, there are two resources - Employees and Skills. The data relationship between the two is one-to-many - a single Employee has many Skills. On the index page (/employees) of the Employees resource, instead of displaying the SkillID property, we are displaying the actual skill Title. On the details page of a single Skill resource (/skills/:id), the Employees with that skill are also displayed.
- Install the Microsoft.VisualStudio.Web.BrowserLink via the Nuget package manager. For more information, see this link
-
For Microsoft SQL Server 2014 Express, see this link for documentation on valid connection strings
-
To get the connection string for a specific database on your MS SQL Server Express, first make sure that you've added the MS SQL Server Express in your SQL Server Object Explorer. You can do this by opening the SQL Server Object Explorer pane, then right-click on SQL Server and choose Add SQL Server. Once you've added your MS SQL Server Express, expand the dropdown list for the MS SQL Server Express then find the database name you wanted to use. Expand the dropdown list on the desired database then right-click on the database and choose Properties.
A Properties tab should open which contains several properties related to the database. On this tab, find the Connection String property then copy its value.
Open the appsettings.json then add the copied connection string under ConnectionStrings field.
- sample appsettings.json file with connection string
-
sample configuration for the ConnectionStrings field in *appsettings.json**
"ConnectionStrings": { "testDB": "Data Source=LAPTOP-VRPV043O\\SQLEXPRESS;Initial Catalog=testEFCore;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" },