Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

#load "../../Common/product.csx"
#load "../Common/product.csx"
#r "Newtonsoft.Json"
#r "Microsoft.Azure.WebJobs.Extensions.Sql"

using System.Net;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using Newtonsoft.Json;

public static Product Run(HttpRequest req, ILogger log, [Sql("dbo.Products", "SqlConnectionString")] out Product product)
public static Product Run(HttpRequest req, ILogger log, out Product product)
{
log.LogInformation("C# HTTP trigger function processed a request.");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

#load "../../Common/product.csx"
#load "../Common/product.csx"
#r "Newtonsoft.Json"
#r "Microsoft.Azure.WebJobs.Extensions.Sql"

using System.Net;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using Newtonsoft.Json;

public static Product Run(HttpRequest req, ILogger log, [Sql("dbo.Products", "SqlConnectionString")] out Product product)
public static Product Run(HttpRequest req, ILogger log, out Product product)
{
log.LogInformation("C# HTTP trigger function processed a request.");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

#load "../../Common/product.csx"
#load "../Common/product.csx"
#r "Newtonsoft.Json"
#r "Microsoft.Azure.WebJobs.Extensions.Sql"

using System.Net;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using Newtonsoft.Json;

public static ProductWithDefaultPK Run(HttpRequest req, ILogger log, [Sql("dbo.ProductsWithDefaultPK", "SqlConnectionString")] out ProductWithDefaultPK product)
public static ProductWithDefaultPK Run(HttpRequest req, ILogger log, out ProductWithDefaultPK product)
{
log.LogInformation("C# HTTP trigger function processed a request.");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

#load "../../Common/product.csx"
#load "../Common/product.csx"
#r "Newtonsoft.Json"
#r "Microsoft.Azure.WebJobs.Extensions.Sql"

using System.Net;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using Newtonsoft.Json;

public static ProductWithoutId Run(HttpRequest req, ILogger log, [Sql("dbo.Products", "SqlConnectionString")] out ProductWithoutId product)
public static ProductWithoutId Run(HttpRequest req, ILogger log, out ProductWithoutId product)
{
log.LogInformation("C# HTTP trigger function processed a request.");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

#load "../../Common/product.csx"
#load "../Common/product.csx"
#r "Newtonsoft.Json"
#r "Microsoft.Azure.WebJobs.Extensions.Sql"

using System.Net;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using Newtonsoft.Json;

public static ProductWithOptionalId Run(HttpRequest req, ILogger log, [Sql("dbo.ProductsWithIdentity", "SqlConnectionString")] out ProductWithOptionalId product)
public static ProductWithOptionalId Run(HttpRequest req, ILogger log, out ProductWithOptionalId product)
{
log.LogInformation("C# HTTP trigger function processed a request.");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

#load "../../Common/product.csx"
#load "../Common/product.csx"
#r "Newtonsoft.Json"
#r "Microsoft.Azure.WebJobs.Extensions.Sql"

using System.Net;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using Newtonsoft.Json;

public static MultiplePrimaryKeyProductWithoutId Run(HttpRequest req, ILogger log, [Sql("dbo.ProductsWithMultiplePrimaryColumnsAndIdentity", "SqlConnectionString")] out MultiplePrimaryKeyProductWithoutId product)
public static MultiplePrimaryKeyProductWithoutId Run(HttpRequest req, ILogger log, out MultiplePrimaryKeyProductWithoutId product)
{
log.LogInformation("C# HTTP trigger function processed a request.");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

#load "../../Common/product.csx"
#load "../Common/product.csx"
#r "Newtonsoft.Json"
#r "Microsoft.Azure.WebJobs.Extensions.Sql"

using System.Net;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using Newtonsoft.Json;

public static Product[] Run(HttpRequest req, ILogger log, [Sql("dbo.Products", "SqlConnectionString")] out Product[] products)
public static Product[] Run(HttpRequest req, ILogger log, out Product[] products)
{
log.LogInformation("C# HTTP trigger function processed a request.");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

#load "../../Common/product.csx"
#load "../Common/product.csx"
#r "Newtonsoft.Json"
#r "Microsoft.Azure.WebJobs.Extensions.Sql"

using System.Collections.Generic;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

public static ICollector<Product> Run(HttpRequest req, ILogger log, [Sql("dbo.Products", "SqlConnectionString")] ICollector<Product> products)
public static ICollector<Product> Run(HttpRequest req, ILogger log, ICollector<Product> products)
{
log.LogInformation("C# HTTP trigger function processed a request.");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

#load "../../Common/product.csx"
#load "../Common/product.csx"
#r "Newtonsoft.Json"
#r "Microsoft.Azure.WebJobs.Extensions.Sql"

using System.Net;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using Newtonsoft.Json;

public static ProductWithoutId[] Run(HttpRequest req, ILogger log, [Sql("dbo.Products", "SqlConnectionString")] out ProductWithoutId[] products)
public static ProductWithoutId[] Run(HttpRequest req, ILogger log, out ProductWithoutId[] products)
{
log.LogInformation("C# HTTP trigger function processed a request.");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

#load "../../Common/product.csx"
#load "../Common/product.csx"
#r "Newtonsoft.Json"
#r "Microsoft.Azure.WebJobs.Extensions.Sql"

using System.Net;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using Newtonsoft.Json;
using System.Collections.Generic;

public static Product[] Run(HttpRequest req, ILogger log, IEnumerable<Product> products, [Sql("dbo.ProductsWithIdentity", "SqlConnectionString")] out Product[] productsWithIdentity)
public static Product[] Run(HttpRequest req, ILogger log, IEnumerable<Product> products, out Product[] productsWithIdentity)
{
log.LogInformation("C# HTTP trigger function processed a request.");
productsWithIdentity = products.ToArray<Product>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

#load "../../Common/product.csx"
#load "../Common/product.csx"
#r "Newtonsoft.Json"

using System.Net;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

#load "../../Common/product.csx"
#load "../Common/product.csx"
#r "Newtonsoft.Json"

using System.Net;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

#load "../../Common/product.csx"
#load "../Common/product.csx"
#r "Newtonsoft.Json"

using System.Net;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

#load "../../Common/product.csx"
#load "../Common/product.csx"
#r "Newtonsoft.Json"

using System.Net;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

#load "../../Common/product.csx"
#load "../Common/product.csx"
#r "Newtonsoft.Json"

using System.Net;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

#load "../../Common/product.csx"
#load "../Common/product.csx"
#r "Newtonsoft.Json"

using System.Net;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

#load "../Common/product.csx"
#r "Newtonsoft.Json"

using System.Net;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using Newtonsoft.Json;
using System.Collections.Generic;

public static IActionResult Run(HttpRequest req, ILogger log, IEnumerable<Product> products)
{
log.LogInformation("C# HTTP trigger function processed a request.");
return new OkObjectResult(products);
}

This file was deleted.

This file was deleted.

This file was deleted.

15 changes: 0 additions & 15 deletions samples/samples-csharpscript/OutputBindingSamples/host.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#load "../../Common/product.csx"
#load "../Common/product.csx"
#r "Newtonsoft.Json"
#r "Microsoft.Azure.WebJobs.Extensions.Sql"

using System;
using System.Collections.Generic;
using System.Diagnostics;
using Newtonsoft.Json;

public static void Run(string queueMessage, ILogger log,
[Sql("[dbo].[Products]", "SqlConnectionString")] ICollector<Product> products)
public static void Run(string queueMessage, ILogger log, ICollector<Product> products)
{
int totalUpserts = 100;
log.LogInformation($"[QueueTrigger]: {DateTime.Now} starting execution {queueMessage}. Rows to generate={totalUpserts}.");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#load "../../Common/product.csx"
#load "../Common/product.csx"
#r "Newtonsoft.Json"
#r "Microsoft.Azure.WebJobs.Extensions.Sql"

Expand All @@ -8,8 +8,7 @@ using System.Diagnostics;
using Newtonsoft.Json;

private static int _executionNumber = 0;
public static void Run(TimerInfo myTimer, ILogger log,
[Sql("Products", "SqlConnectionString")] ICollector<Product> products)
public static void Run(TimerInfo myTimer, ILogger log, ICollector<Product> products)
{
int totalUpserts = 1000;
log.LogInformation($"{DateTime.Now} starting execution #{_executionNumber}. Rows to generate={totalUpserts}.");
Expand Down
7 changes: 1 addition & 6 deletions test/Microsoft.Azure.WebJobs.Extensions.Sql.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,10 @@
<Copy SourceFiles="@(_PythonCopyItems)" DestinationFolder="$(OutDir)\SqlExtensionSamples\Python\%(RecursiveDir)" />
<Message Text="Copied Python Samples output to $(OutDir)\SqlExtensionSamples\Python" Importance="high" />
<ItemGroup>
<_CSharpScriptCopyItems Include="..\samples\samples-csharpscript\InputBindingSamples\**\*.*" />
<_CSharpScriptCopyItems Include="..\samples\samples-csharpscript\OutputBindingSamples\**\*.*" />
<_CSharpScriptCopyItems Include="..\samples\samples-csharpscript\**\*.*" />
<_CSharpScriptCopyItems Include="Integration\test-csx\**\*.*" />
</ItemGroup>
<Copy SourceFiles="@(_CSharpScriptCopyItems)" DestinationFolder="$(OutDir)\SqlExtensionSamples\CSharpscript\%(RecursiveDir)" />
<ItemGroup>
<_CommonCopyItems Include="..\samples\samples-csharpscript\Common\**\*.*" />
</ItemGroup>
<Copy SourceFiles="@(_CommonCopyItems)" DestinationFolder="$(OutDir)\SqlExtensionSamples\Common\%(RecursiveDir)" />
<Message Text="Copied CSX Samples output to $(OutDir)\SqlExtensionSamples\CSharpscript" Importance="high" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Message Text="Copied CSX Samples output to $(OutDir)\SqlExtensionSamples\CSharpscript" Importance="high" />
<Message Text="Copied CSX Samples output to $(OutDir)\SqlExtensionSamples\Csx" Importance="high" />

</Target>
</Project>