From e8a4220cf5120b0262fe2fa3f7fa1f73f8d9efeb Mon Sep 17 00:00:00 2001 From: Jovan Popovic Date: Tue, 1 Nov 2016 17:25:57 -0700 Subject: [PATCH 1/2] Updated Belgrade demo Updated NuGet package and sample scripts --- .../BelgradeProductCatalogDemo/project.json | 2 +- .../sql-scripts/2 json.sql | 35 +++++++++++++++++-- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/samples/demos/BelgradeProductCatalogDemo/project.json b/samples/demos/BelgradeProductCatalogDemo/project.json index 3c2700d7..b62d09db 100644 --- a/samples/demos/BelgradeProductCatalogDemo/project.json +++ b/samples/demos/BelgradeProductCatalogDemo/project.json @@ -1,6 +1,6 @@ { "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", 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 From c9702aa4fe093d50656f7721153b41532fec0cb9 Mon Sep 17 00:00:00 2001 From: Jovan Popovic Date: Fri, 4 Nov 2016 13:04:31 -0700 Subject: [PATCH 2/2] Removed Caching.Memory Removed references to Caching.Memory from the project due to issues with .net 4.6 compilaiton on mac. --- samples/demos/BelgradeProductCatalogDemo/.gitignore | 3 ++- samples/demos/BelgradeProductCatalogDemo/Startup.cs | 1 - samples/demos/BelgradeProductCatalogDemo/project.json | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) 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 b62d09db..974e6c10 100644 --- a/samples/demos/BelgradeProductCatalogDemo/project.json +++ b/samples/demos/BelgradeProductCatalogDemo/project.json @@ -6,7 +6,6 @@ "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-*" } } },