diff --git a/test-outofproc/MultiFunctionTrigger.cs b/test-outofproc/MultiFunctionTrigger.cs index c583e601a..cfc49fbe4 100644 --- a/test-outofproc/MultiFunctionTrigger.cs +++ b/test-outofproc/MultiFunctionTrigger.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. +using System; using System.Collections.Generic; using DotnetIsolatedTests.Common; using Microsoft.Extensions.Logging; @@ -15,22 +16,24 @@ namespace DotnetIsolatedTests /// public static class MultiFunctionTrigger { + private static readonly Action _loggerMessage = LoggerMessage.Define(LogLevel.Information, eventId: new EventId(0, "INFO"), formatString: "{Message}"); + [Function(nameof(MultiFunctionTrigger1))] public static void MultiFunctionTrigger1( [SqlTrigger("[dbo].[Products]", "SqlConnectionString")] IReadOnlyList> products, - ILogger logger) + FunctionContext context) { - logger.LogInformation("Trigger1 Changes: " + Utils.JsonSerializeObject(products)); + _loggerMessage(context.GetLogger("ProductsTriggerWithValidation"), "Trigger1 Changes: " + Utils.JsonSerializeObject(products), null); } [Function(nameof(MultiFunctionTrigger2))] public static void MultiFunctionTrigger2( [SqlTrigger("[dbo].[Products]", "SqlConnectionString")] IReadOnlyList> products, - ILogger logger) + FunctionContext context) { - logger.LogInformation("Trigger2 Changes: " + Utils.JsonSerializeObject(products)); + _loggerMessage(context.GetLogger("ProductsTriggerWithValidation"), "Trigger2 Changes: " + Utils.JsonSerializeObject(products), null); } } } diff --git a/test/Integration/SqlTriggerBindingIntegrationTests.cs b/test/Integration/SqlTriggerBindingIntegrationTests.cs index 9267960de..431af210f 100644 --- a/test/Integration/SqlTriggerBindingIntegrationTests.cs +++ b/test/Integration/SqlTriggerBindingIntegrationTests.cs @@ -168,7 +168,7 @@ await this.WaitForProductChanges( /// [Theory] [SqlInlineData()] - [UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)] + [UnsupportedLanguages(SupportedLanguages.CSharpscript)] public async Task PollingIntervalOverrideTriggerTest(SupportedLanguages lang) { const int firstId = 1; @@ -293,7 +293,7 @@ await this.WaitForProductChanges( /// [Theory] [SqlInlineData()] - [UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)] + [UnsupportedLanguages(SupportedLanguages.CSharpscript)] public async Task MultiFunctionTriggerTest(SupportedLanguages lang) { const string Trigger1Changes = "Trigger1 Changes: "; @@ -472,7 +472,7 @@ await this.WaitForProductChanges( /// [Theory] [SqlInlineData()] - [UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)] + [UnsupportedLanguages(SupportedLanguages.CSharpscript)] public void TableNotPresentTriggerTest(SupportedLanguages lang) { this.StartFunctionHostAndWaitForError( @@ -487,7 +487,7 @@ public void TableNotPresentTriggerTest(SupportedLanguages lang) /// [Theory] [SqlInlineData()] - [UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)] + [UnsupportedLanguages(SupportedLanguages.CSharpscript)] public void PrimaryKeyNotCreatedTriggerTest(SupportedLanguages lang) { this.StartFunctionHostAndWaitForError( @@ -503,7 +503,7 @@ public void PrimaryKeyNotCreatedTriggerTest(SupportedLanguages lang) /// [Theory] [SqlInlineData()] - [UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)] + [UnsupportedLanguages(SupportedLanguages.CSharpscript)] public void ReservedPrimaryKeyColumnNamesTriggerTest(SupportedLanguages lang) { this.StartFunctionHostAndWaitForError( @@ -519,7 +519,7 @@ public void ReservedPrimaryKeyColumnNamesTriggerTest(SupportedLanguages lang) /// [Theory] [SqlInlineData()] - [UnsupportedLanguages(SupportedLanguages.OutOfProc, SupportedLanguages.CSharpscript)] + [UnsupportedLanguages(SupportedLanguages.CSharpscript)] public void UnsupportedColumnTypesTriggerTest(SupportedLanguages lang) { this.StartFunctionHostAndWaitForError(