From adf54ed9c3b145362efca03b913b60681d7477d1 Mon Sep 17 00:00:00 2001 From: Jeremy <517429+JeremyMelton@users.noreply.github.com> Date: Fri, 18 Jul 2025 22:38:55 -0600 Subject: [PATCH 1/2] updated to latest tly changes --- .../AsyncHelper.cs | 17 ++++------------- .../ChannelProviderDeliveryReportController.cs | 3 ++- .../ChannelProviderModelBinderProvider.cs | 5 +++-- .../DefaultRequestAdaptorContext.cs | 5 ++++- .../TransmitlyAspNetMvcExtensions.cs | 3 --- 5 files changed, 13 insertions(+), 20 deletions(-) diff --git a/src/Transmitly.Microsoft.Aspnet.Mvc/AsyncHelper.cs b/src/Transmitly.Microsoft.Aspnet.Mvc/AsyncHelper.cs index 752cf75..360af5a 100644 --- a/src/Transmitly.Microsoft.Aspnet.Mvc/AsyncHelper.cs +++ b/src/Transmitly.Microsoft.Aspnet.Mvc/AsyncHelper.cs @@ -1,16 +1,7 @@ -// Copyright (c) Code Impressions, LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License") -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +#pragma warning disable IDE0073 // The file header does not match the required text +// Copyright (c) Microsoft Corporation, Inc. All rights reserved. +// Licensed under the MIT License, Version 2.0. See License.txt in the project root for license information. +#pragma warning restore IDE0073 // The file header does not match the required text using System; using System.Globalization; diff --git a/src/Transmitly.Microsoft.Aspnet.Mvc/ChannelProviderDeliveryReportController.cs b/src/Transmitly.Microsoft.Aspnet.Mvc/ChannelProviderDeliveryReportController.cs index e159a79..686a7c8 100644 --- a/src/Transmitly.Microsoft.Aspnet.Mvc/ChannelProviderDeliveryReportController.cs +++ b/src/Transmitly.Microsoft.Aspnet.Mvc/ChannelProviderDeliveryReportController.cs @@ -16,6 +16,7 @@ using System.Web.Mvc; using System.Net; using Transmitly.Delivery; +using Transmitly.Util; namespace Transmitly { @@ -37,7 +38,7 @@ public virtual ActionResult HandleDeliveryReport(ChannelProviderDeliveryReportRe { if (ModelState.IsValid && request != null && request.DeliveryReports != null) { - _communicationsClient.DeliverReports(request.DeliveryReports); + _communicationsClient.DispatchAsync(request.DeliveryReports); return new HttpStatusCodeResult(HttpStatusCode.OK); } return new HttpStatusCodeResult(HttpStatusCode.InternalServerError, string.Join("; ", ModelState.Values.SelectMany(v => v.Errors))); diff --git a/src/Transmitly.Microsoft.Aspnet.Mvc/ChannelProviderModelBinderProvider.cs b/src/Transmitly.Microsoft.Aspnet.Mvc/ChannelProviderModelBinderProvider.cs index 4384c26..a0bf921 100644 --- a/src/Transmitly.Microsoft.Aspnet.Mvc/ChannelProviderModelBinderProvider.cs +++ b/src/Transmitly.Microsoft.Aspnet.Mvc/ChannelProviderModelBinderProvider.cs @@ -18,6 +18,7 @@ using Transmitly.ChannelProvider.Configuration; using Transmitly.Delivery; using System.Web.Mvc; +using Transmitly.Util; namespace Transmitly.Microsoft.Aspnet.Mvc { @@ -32,13 +33,13 @@ public ChannelProviderModelBinderProvider(IChannelProviderFactory channelProvide { Guard.AgainstNull(channelProviderFactory); var adaptors = AsyncHelper.RunSync(channelProviderFactory.GetAllDeliveryReportRequestAdaptorsAsync); - _adaptorInstances = adaptors.Select(s => + _adaptorInstances = [.. adaptors.Select(s => new Lazy( () => AsyncHelper.RunSync( () => channelProviderFactory.ResolveDeliveryReportRequestAdaptorAsync(s) ) ) - ).ToList(); + )]; } public IModelBinder? GetBinder(Type modelType) diff --git a/src/Transmitly.Microsoft.Aspnet.Mvc/DefaultRequestAdaptorContext.cs b/src/Transmitly.Microsoft.Aspnet.Mvc/DefaultRequestAdaptorContext.cs index 08b509a..0889064 100644 --- a/src/Transmitly.Microsoft.Aspnet.Mvc/DefaultRequestAdaptorContext.cs +++ b/src/Transmitly.Microsoft.Aspnet.Mvc/DefaultRequestAdaptorContext.cs @@ -51,10 +51,13 @@ public string GetValue(string key) public string Content { get; } = requestBody; - public string PipelineName => GetValue(DeliveryUtil.PipelineNameKey); public string ResourceId => GetValue(DeliveryUtil.ResourceIdKey); public IDictionary QueryString => _queryString; + + public string? PipelineIntent => GetValue(DeliveryUtil.PipelineIntentKey); + + public string? PipelineId => GetValue(DeliveryUtil.PipelineIdKey); } } diff --git a/src/Transmitly.Microsoft.Aspnet.Mvc/TransmitlyAspNetMvcExtensions.cs b/src/Transmitly.Microsoft.Aspnet.Mvc/TransmitlyAspNetMvcExtensions.cs index c0eeea2..55a8784 100644 --- a/src/Transmitly.Microsoft.Aspnet.Mvc/TransmitlyAspNetMvcExtensions.cs +++ b/src/Transmitly.Microsoft.Aspnet.Mvc/TransmitlyAspNetMvcExtensions.cs @@ -16,9 +16,6 @@ using Transmitly.ChannelProvider.Configuration; using System.Web.Mvc; using Transmitly.Microsoft.Aspnet.Mvc; -using System.Net; -using Transmitly.Delivery; -using System; namespace Transmitly { From e394b62887d7efb4619dd6636cbe7dd5fda593fc Mon Sep 17 00:00:00 2001 From: Jeremy <517429+JeremyMelton@users.noreply.github.com> Date: Sat, 19 Jul 2025 22:51:24 -0600 Subject: [PATCH 2/2] update 0.2.0 --- .../Transmitly.Microsoft.Aspnet.Mvc.csproj | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/Transmitly.Microsoft.Aspnet.Mvc/Transmitly.Microsoft.Aspnet.Mvc.csproj b/src/Transmitly.Microsoft.Aspnet.Mvc/Transmitly.Microsoft.Aspnet.Mvc.csproj index b80d12c..865ea14 100644 --- a/src/Transmitly.Microsoft.Aspnet.Mvc/Transmitly.Microsoft.Aspnet.Mvc.csproj +++ b/src/Transmitly.Microsoft.Aspnet.Mvc/Transmitly.Microsoft.Aspnet.Mvc.csproj @@ -1,5 +1,4 @@  - net48;net471;net472 enable @@ -24,22 +23,20 @@ - - True - \ - - - True - \ - - - - - + + True + \ + + + True + \ + + +