diff --git a/samples/features/json/comments/dotnet-react-jquery-app/.gitignore b/samples/features/json/comments/dotnet-react-jquery-app/.gitignore
index d87d053b..49c4bbd1 100644
--- a/samples/features/json/comments/dotnet-react-jquery-app/.gitignore
+++ b/samples/features/json/comments/dotnet-react-jquery-app/.gitignore
@@ -4,4 +4,6 @@
bin/*
obj/*
*.sln
-*.log
\ No newline at end of file
+*.log
+Properties/PublishProfiles/*
+appsettings.development.json
\ No newline at end of file
diff --git a/samples/features/json/comments/dotnet-react-jquery-app/CommentsReactApp.xproj b/samples/features/json/comments/dotnet-react-jquery-app/CommentsReactApp.xproj
index 12b368c7..964f28b5 100644
--- a/samples/features/json/comments/dotnet-react-jquery-app/CommentsReactApp.xproj
+++ b/samples/features/json/comments/dotnet-react-jquery-app/CommentsReactApp.xproj
@@ -7,7 +7,7 @@
c8014cba-1952-414a-b78e-f60f9e5c5625
- CommentsApp
+ ReactCommentsApp
.\obj
.\bin\
v4.6
diff --git a/samples/features/json/comments/dotnet-react-jquery-app/Controllers/commentsController.cs b/samples/features/json/comments/dotnet-react-jquery-app/Controllers/commentsController.cs
index 50e102c7..e8830109 100644
--- a/samples/features/json/comments/dotnet-react-jquery-app/Controllers/commentsController.cs
+++ b/samples/features/json/comments/dotnet-react-jquery-app/Controllers/commentsController.cs
@@ -4,7 +4,7 @@ using System.Data.SqlClient;
using System.IO;
using System.Threading.Tasks;
-namespace CommentApp.Controllers
+namespace ReactCommentsApp.Controllers
{
[Route("api/[controller]")]
public class commentsController : Controller
diff --git a/samples/features/json/comments/dotnet-react-jquery-app/Program.cs b/samples/features/json/comments/dotnet-react-jquery-app/Program.cs
index 8f0fec07..c36a1e09 100644
--- a/samples/features/json/comments/dotnet-react-jquery-app/Program.cs
+++ b/samples/features/json/comments/dotnet-react-jquery-app/Program.cs
@@ -1,12 +1,8 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Threading.Tasks;
+using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Builder;
+using System.IO;
-namespace TodoApp
+namespace ReactCommentsApp
{
public class Program
{
diff --git a/samples/features/json/comments/dotnet-react-jquery-app/README.md b/samples/features/json/comments/dotnet-react-jquery-app/README.md
index 88ea22dc..9c1fcc60 100644
--- a/samples/features/json/comments/dotnet-react-jquery-app/README.md
+++ b/samples/features/json/comments/dotnet-react-jquery-app/README.md
@@ -46,9 +46,28 @@ To run this sample, you need the following prerequisites.
3. From Visual Studio 2015, open the **CommentsReactApp.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 CommentsDb 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).
+4. Add a connection string in appsettings.json or appsettings.development.json file. An example of the content of appsettings.development.json is shown in the following configuration:
-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.
+```
+{
+ "ConnectionStrings": {
+ "CommentsDb": "Server=.;Database=CommentsDb;Integrated Security=true"
+ }
+}
+```
+
+If your database is hosted on Azure you can add something like:
+```
+{
+ "ConnectionStrings": {
+ "ProductCatalog": "Server=<>.database.windows.net;Database=CommentsDb;User Id=<>;Password=<>"
+ }
+}
+```
+
+### Build and run sample
+
+1. 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.
1. Open /index.html Url to get all comments from database,
2. Add new comment using the form below the list of comments.
diff --git a/samples/features/json/comments/dotnet-react-jquery-app/Startup.cs b/samples/features/json/comments/dotnet-react-jquery-app/Startup.cs
index 4c02bacf..909f839d 100644
--- a/samples/features/json/comments/dotnet-react-jquery-app/Startup.cs
+++ b/samples/features/json/comments/dotnet-react-jquery-app/Startup.cs
@@ -7,7 +7,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using System.Data.SqlClient;
-namespace TodoApp
+namespace ReactCommentsApp
{
public class Startup
{
@@ -26,8 +26,7 @@ namespace TodoApp
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
- //const string ConnString = "Server=SERVERNAME.database.windows.net;Database=DATABASENAME;User Id=USERNAME;Password=PASSWORD";
- const string ConnString = "Server=.;Database=CommentsDb;Integrated Security=true";
+ string ConnString = Configuration["ConnectionStrings:CommentsDb"];
services.AddTransient( _=> new QueryPipe(new SqlConnection(ConnString)));
services.AddTransient( _=> new Command(new SqlConnection(ConnString)));
diff --git a/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/.gitignore b/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/.gitignore
index 8b5804c3..43f40bc0 100644
--- a/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/.gitignore
+++ b/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/.gitignore
@@ -5,4 +5,6 @@ bin/*
obj/*
*.sln
*.log
-*.lock.json
\ No newline at end of file
+*.lock.json
+Properties/PublishProfiles/*
+appsettings.development.json
\ No newline at end of file
diff --git a/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/README.md b/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/README.md
index fe2ee8a0..166b5c99 100644
--- a/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/README.md
+++ b/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/README.md
@@ -39,15 +39,38 @@ To run this sample, you need the following prerequisites.
## Run this sample
+### Setup
+
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 [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).
+4. Add a connection string in appsettings.json or appsettings.development.json file. An example of the content of appsettings.development.json is shown in the following configuration:
-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.
+```
+{
+ "ConnectionStrings": {
+ "ProductCatalog": "Server=.;Database=ProductCatalog;Integrated Security=true"
+ }
+}
+```
+
+If your database is hosted on Azure you can add something like:
+```
+{
+ "ConnectionStrings": {
+ "ProductCatalog": "Server=<>.database.windows.net;Database=ProductCatalog;User Id=<>;Password=<>"
+ }
+}
+```
+
+### Build and run sample
+
+1. 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).
+
+2. 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.
1. Open /index.html Url to get all products from database,
2. Use **Add** button to add a new product,
3. Edit a product using **Edit** button in table,
diff --git a/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/Startup.cs b/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/Startup.cs
index c6bb28cb..53f93b7f 100644
--- a/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/Startup.cs
+++ b/samples/features/json/product-catalog/dotnet-jquery-bootstrap-app/Startup.cs
@@ -26,9 +26,7 @@ namespace ProductCatalog
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
- //const string ConnString = "Server=<>.database.windows.net;Database=<>;User Id=<>;Password=<>";
- const string ConnString = "Server=.;Database=ProductCatalog;Integrated Security=true";
-
+ string ConnString = Configuration["ConnectionStrings:ProductCatalog"];
services.AddTransient(_ => new QueryPipe(new SqlConnection(ConnString)));
services.AddTransient(_ => new Command(new SqlConnection(ConnString)));