diff --git a/samples/demos/BelgradeProductCatalogDemo/.gitignore b/samples/demos/BelgradeProductCatalogDemo/.gitignore index cee26d9b..d012fcb9 100644 --- a/samples/demos/BelgradeProductCatalogDemo/.gitignore +++ b/samples/demos/BelgradeProductCatalogDemo/.gitignore @@ -7,4 +7,5 @@ obj/* *.log *.lock.json Properties/PublishProfiles/* -appsettings.Development.json \ No newline at end of file +appsettings.Development.json +appsettings.Production.json \ No newline at end of file diff --git a/samples/demos/BelgradeProductCatalogDemo/Startup.cs b/samples/demos/BelgradeProductCatalogDemo/Startup.cs index f4f13ad0..42eb7458 100644 --- a/samples/demos/BelgradeProductCatalogDemo/Startup.cs +++ b/samples/demos/BelgradeProductCatalogDemo/Startup.cs @@ -54,7 +54,6 @@ namespace ProductCatalog // Add framework services. services.AddSingleton(); - services.AddDistributedMemoryCache(); services.AddSession(); services.AddMvc(); } diff --git a/samples/demos/BelgradeProductCatalogDemo/project.json b/samples/demos/BelgradeProductCatalogDemo/project.json index 3c2700d7..974e6c10 100644 --- a/samples/demos/BelgradeProductCatalogDemo/project.json +++ b/samples/demos/BelgradeProductCatalogDemo/project.json @@ -1,12 +1,11 @@ { "dependencies": { - "Belgrade.Sql.Client": "0.5.1", + "Belgrade.Sql.Client": "0.5.2", "Microsoft.AspNetCore.Mvc": "1.0.0", "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", "Microsoft.AspNetCore.Session": "1.0.0", "Microsoft.AspNetCore.StaticFiles": "1.0.0", - "Microsoft.Extensions.Caching.Memory": "1.0.0", "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0", "Microsoft.Extensions.Configuration.Json": "1.0.0", @@ -34,7 +33,6 @@ }, "net46": { "dependencies": { - "Microsoft.Framework.Caching.Memory": "1.0.0-*" } } }, diff --git a/samples/demos/BelgradeProductCatalogDemo/sql-scripts/2 json.sql b/samples/demos/BelgradeProductCatalogDemo/sql-scripts/2 json.sql index 046f1a83..65f193cc 100644 --- a/samples/demos/BelgradeProductCatalogDemo/sql-scripts/2 json.sql +++ b/samples/demos/BelgradeProductCatalogDemo/sql-scripts/2 json.sql @@ -1,8 +1,39 @@ - ---Combine standard columns with JSON columns. +--Combine standard columns with JSON columns. select Name,Color,Size,Price,Quantity,Data,Tags from Product +/* Basic Demo */ + + +-- Get List of products +select ProductID, Name,Color,Size,Price,Quantity, + JSON_VALUE(Data, '$.MadeIn') as MadeIn, + JSON_QUERY(Tags) as Tags +from Product +FOR JSON PATH + +-- Get Product details +select Name,Color,Size,Price,Quantity +from Product +where ProductID = 17 +FOR JSON PATH, WITHOUT_ARRAY_WRAPPER + +-- Insert new product +declare @p nvarchar(4000) = +N'{"Name":"NEW","Color":"Magenta","Size":"62", + "Price":28.9900,"Quantity":80}' +EXEC dbo.InsertProductFromJson @p + +-- Update product +declare @p nvarchar(4000) = +N'{"Name":"HL Bottom Bracket","Price":121.4900,"Quantity":65}' + +EXEC dbo.UpdateProductFromJson 28, @p + +/* End Basic Demo */ + +/* Detailed Demo */ + --Use JSON Data in queries select ProductID, Name, Color, Size, Price, Quantity, Data, Tags, JSON_VALUE(Data, '$.MadeIn') as MadeIn