Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
17 changes: 4 additions & 13 deletions src/Transmitly.Microsoft.Aspnet.Mvc/AsyncHelper.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using System.Web.Mvc;
using System.Net;
using Transmitly.Delivery;
using Transmitly.Util;

namespace Transmitly
{
Expand All @@ -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)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using Transmitly.ChannelProvider.Configuration;
using Transmitly.Delivery;
using System.Web.Mvc;
using Transmitly.Util;

namespace Transmitly.Microsoft.Aspnet.Mvc
{
Expand All @@ -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<IChannelProviderDeliveryReportRequestAdaptor>(
() => AsyncHelper.RunSync(
() => channelProviderFactory.ResolveDeliveryReportRequestAdaptorAsync(s)
)
)
).ToList();
)];
}

public IModelBinder? GetBinder(Type modelType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string> QueryString => _queryString;

public string? PipelineIntent => GetValue(DeliveryUtil.PipelineIntentKey);

public string? PipelineId => GetValue(DeliveryUtil.PipelineIdKey);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net48;net471;net472</TargetFrameworks>
<Nullable>enable</Nullable>
Expand All @@ -24,22 +23,20 @@
</PropertyGroup>

<ItemGroup>
<None Include="..\..\assets\icon-dark.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNet.Mvc" Version="5.2.7" />
<PackageReference Include="Transmitly" Version="0.1.0-271.a05261c" />
<None Include="..\..\assets\icon-dark.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="PolySharp" Version="1.14.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.AspNet.Mvc" Version="5.2.7" />
<PackageReference Include="Transmitly" Version="0.2.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Net.Http" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down