mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
Updated README
This commit is contained in:
@ -40,18 +40,18 @@ To run this sample, you need the following prerequisites.
|
||||
|
||||
1. Create a database on SQL Server 2016 or Azure SQL Database and set compatibility level to 130.
|
||||
|
||||
2. From SQL Server Management Studio or Sql Server Data Tools connect to your SQL Server 2016 or Azure SQL database and execute setup.sql script that will create and populate Product table and create required stored procedures.
|
||||
2. From SQL Server Management Studio or Sql Server Data Tools connect to your SQL Server 2016 or Azure SQL database and execute [sql-scripts/setup.sql](sql-scripts/setup.sql) script that will create and populate Product table and create required stored procedures.
|
||||
|
||||
3. From Visual Studio 2015, open the **ProductCatalog.xproj** file from the root directory. Restore packages using right-click menu on the project in Visual Studio and by choosing Restore Packages item. As an alternative, you may run **dotnet restore** from the command line (from the root folder of application).
|
||||
|
||||
4. Locate Startup.cs file in the project, change connection string in ConfigureServices() method to reference your database (default value ProductCatalog database on local instance with integrated security), and build solution using Ctrl+Shift+B, right-click on project + Build, Build/Build Solution from menu, or **dotnet build** command from the command line (from the root folder of application).
|
||||
|
||||
5. Run the sample app using F5 or Ctrl+F5 in Visual Studio 2015, or using **dotnet run** executed in the command prompt of the project root folder.
|
||||
5.1. Open /api/Product Url to get all products from database,
|
||||
5.2. Open /api/Product/18 Url to get the product with id,
|
||||
5.3. Send POST Http request to /api/Product Url with JSON like {"ProductID":18,"Name":"Blade","Color":"Magenta","Price":18.0000,"Quantity":45} in the body of request to create new product,
|
||||
5.4. Send PUT Http request with JSON like {"ProductID":18,"Name":"Blade","Color":"Magenta","Price":18.0000,"Quantity":45} in the body of request to update the product with specified id,
|
||||
5.5. Send DELETE Http request /api/Product/18 Url to delete the product with specified id(18),
|
||||
1. Open /api/Product Url to get all products from database,
|
||||
2. Open /api/Product/18 Url to get the product with id,
|
||||
3. Send POST Http request to /api/Product Url with JSON like {"Name":"Blade","Color":"Magenta","Price":18.0000,"Quantity":45} in the body of request to create new product,
|
||||
4. Send PUT Http request with JSON like {"Name":"Blade","Color":"Magenta","Price":18.0000,"Quantity":45} in the body of request to update the product with specified id,
|
||||
5. Send DELETE Http request /api/Product/18 Url to delete the product with specified id(18),
|
||||
|
||||
<a name=sample-details></a>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user