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/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 + \ + + + 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 {