Skip to content

Commit 5fae58d

Browse files
authored
Merge pull request #2 from transmitly/refactor/core
refactor: core
2 parents 5d5a0cc + e394b62 commit 5fae58d

File tree

6 files changed

+23
-33
lines changed

6 files changed

+23
-33
lines changed

src/Transmitly.Microsoft.Aspnet.Mvc/AsyncHelper.cs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
1-
// Copyright (c) Code Impressions, LLC. All Rights Reserved.
2-
//
3-
// Licensed under the Apache License, Version 2.0 (the "License")
4-
// you may not use this file except in compliance with the License.
5-
// You may obtain a copy of the License at
6-
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
8-
//
9-
// Unless required by applicable law or agreed to in writing, software
10-
// distributed under the License is distributed on an "AS IS" BASIS,
11-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
// See the License for the specific language governing permissions and
13-
// limitations under the License.
1+
#pragma warning disable IDE0073 // The file header does not match the required text
2+
// Copyright (c) Microsoft Corporation, Inc. All rights reserved.
3+
// Licensed under the MIT License, Version 2.0. See License.txt in the project root for license information.
4+
#pragma warning restore IDE0073 // The file header does not match the required text
145

156
using System;
167
using System.Globalization;

src/Transmitly.Microsoft.Aspnet.Mvc/ChannelProviderDeliveryReportController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using System.Web.Mvc;
1717
using System.Net;
1818
using Transmitly.Delivery;
19+
using Transmitly.Util;
1920

2021
namespace Transmitly
2122
{
@@ -37,7 +38,7 @@ public virtual ActionResult HandleDeliveryReport(ChannelProviderDeliveryReportRe
3738
{
3839
if (ModelState.IsValid && request != null && request.DeliveryReports != null)
3940
{
40-
_communicationsClient.DeliverReports(request.DeliveryReports);
41+
_communicationsClient.DispatchAsync(request.DeliveryReports);
4142
return new HttpStatusCodeResult(HttpStatusCode.OK);
4243
}
4344
return new HttpStatusCodeResult(HttpStatusCode.InternalServerError, string.Join("; ", ModelState.Values.SelectMany(v => v.Errors)));

src/Transmitly.Microsoft.Aspnet.Mvc/ChannelProviderModelBinderProvider.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
using Transmitly.ChannelProvider.Configuration;
1919
using Transmitly.Delivery;
2020
using System.Web.Mvc;
21+
using Transmitly.Util;
2122

2223
namespace Transmitly.Microsoft.Aspnet.Mvc
2324
{
@@ -32,13 +33,13 @@ public ChannelProviderModelBinderProvider(IChannelProviderFactory channelProvide
3233
{
3334
Guard.AgainstNull(channelProviderFactory);
3435
var adaptors = AsyncHelper.RunSync(channelProviderFactory.GetAllDeliveryReportRequestAdaptorsAsync);
35-
_adaptorInstances = adaptors.Select(s =>
36+
_adaptorInstances = [.. adaptors.Select(s =>
3637
new Lazy<IChannelProviderDeliveryReportRequestAdaptor>(
3738
() => AsyncHelper.RunSync(
3839
() => channelProviderFactory.ResolveDeliveryReportRequestAdaptorAsync(s)
3940
)
4041
)
41-
).ToList();
42+
)];
4243
}
4344

4445
public IModelBinder? GetBinder(Type modelType)

src/Transmitly.Microsoft.Aspnet.Mvc/DefaultRequestAdaptorContext.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,13 @@ public string GetValue(string key)
5151

5252
public string Content { get; } = requestBody;
5353

54-
public string PipelineName => GetValue(DeliveryUtil.PipelineNameKey);
5554

5655
public string ResourceId => GetValue(DeliveryUtil.ResourceIdKey);
5756

5857
public IDictionary<string, string> QueryString => _queryString;
58+
59+
public string? PipelineIntent => GetValue(DeliveryUtil.PipelineIntentKey);
60+
61+
public string? PipelineId => GetValue(DeliveryUtil.PipelineIdKey);
5962
}
6063
}

src/Transmitly.Microsoft.Aspnet.Mvc/Transmitly.Microsoft.Aspnet.Mvc.csproj

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
32
<PropertyGroup>
43
<TargetFrameworks>net48;net471;net472</TargetFrameworks>
54
<Nullable>enable</Nullable>
@@ -24,22 +23,20 @@
2423
</PropertyGroup>
2524

2625
<ItemGroup>
27-
<None Include="..\..\assets\icon-dark.png">
28-
<Pack>True</Pack>
29-
<PackagePath>\</PackagePath>
30-
</None>
31-
<None Include="..\..\README.md">
32-
<Pack>True</Pack>
33-
<PackagePath>\</PackagePath>
34-
</None>
35-
</ItemGroup>
36-
<ItemGroup>
37-
<PackageReference Include="Microsoft.AspNet.Mvc" Version="5.2.7" />
38-
<PackageReference Include="Transmitly" Version="0.1.0-271.a05261c" />
26+
<None Include="..\..\assets\icon-dark.png">
27+
<Pack>True</Pack>
28+
<PackagePath>\</PackagePath>
29+
</None>
30+
<None Include="..\..\README.md">
31+
<Pack>True</Pack>
32+
<PackagePath>\</PackagePath>
33+
</None>
3934
</ItemGroup>
4035
<ItemGroup>
4136
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
4237
<PackageReference Include="PolySharp" Version="1.14.1" PrivateAssets="All" />
38+
<PackageReference Include="Microsoft.AspNet.Mvc" Version="5.2.7" />
39+
<PackageReference Include="Transmitly" Version="0.2.0" />
4340
</ItemGroup>
4441
<ItemGroup>
4542
<Reference Include="System.Net.Http" />

src/Transmitly.Microsoft.Aspnet.Mvc/TransmitlyAspNetMvcExtensions.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
using Transmitly.ChannelProvider.Configuration;
1717
using System.Web.Mvc;
1818
using Transmitly.Microsoft.Aspnet.Mvc;
19-
using System.Net;
20-
using Transmitly.Delivery;
21-
using System;
2219

2320
namespace Transmitly
2421
{

0 commit comments

Comments
 (0)