test-outofproc/AddProductDefaultPKAndDifferentColumnOrder.cs (22 lines of code) (raw):

// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. using DotnetIsolatedTests.Common; using Microsoft.AspNetCore.Http; using Microsoft.Azure.Functions.Worker; using Microsoft.Azure.Functions.Worker.Extensions.MySql; namespace DotnetIsolatedTests { public static class AddProductDefaultPKAndDifferentColumnOrder { /// <summary> /// This shows an example of a MySQL Output binding where the target table has a default primary key /// of type uniqueidentifier and the column is not included in the output object. The order of the /// properties in the POCO is different from the order of the columns in the MySQL table. A new row will /// be inserted and the uniqueidentifier will be generated by the engine. /// </summary> [Function(nameof(AddProductDefaultPKAndDifferentColumnOrder))] [MySqlOutput("ProductsWithDefaultPK", "MySqlConnectionString")] public static ProductDefaultPKWithDifferentColumnOrder Run( [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "addproductdefaultpkanddifferentcolumnorder")] HttpRequest req) { var product = new ProductDefaultPKWithDifferentColumnOrder() { Cost = 100, Name = "test" }; return product; } } }