Skip to content

Commit 35f0223

Browse files
committed
create special directory
1 parent 5c07ca2 commit 35f0223

18 files changed

+426
-303
lines changed

src/Microsoft.Extensions.ServiceDiscovery.Abstractions/FrameworkExtensions.Shared.cs

Lines changed: 0 additions & 134 deletions
This file was deleted.

src/Microsoft.Extensions.ServiceDiscovery.Abstractions/Microsoft.Extensions.ServiceDiscovery.Abstractions.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,7 @@
2222
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
2323
<PackageReference Include="Microsoft.Bcl.Memory" />
2424
</ItemGroup>
25+
26+
<Import Project="$(SharedDir)FxPolyfills\FxPolyfills.targets" />
2527

2628
</Project>

src/Microsoft.Extensions.ServiceDiscovery/FrameworkExtensions.cs

Lines changed: 0 additions & 153 deletions
This file was deleted.
Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFrameworks>$(DefaultTargetFramework);net462</TargetFrameworks>
@@ -8,10 +8,6 @@
88
<PackageIconFullPath>$(DefaultDotnetIconFullPath)</PackageIconFullPath>
99
</PropertyGroup>
1010

11-
<ItemGroup>
12-
<Compile Include="..\Microsoft.Extensions.ServiceDiscovery.Abstractions\FrameworkExtensions.Shared.cs" Link="FrameworkExtensions.Shared.cs" />
13-
</ItemGroup>
14-
1511
<ItemGroup>
1612
<PackageReference Include="Microsoft.Extensions.Http" />
1713
<InternalsVisibleTo Include="Microsoft.Extensions.ServiceDiscovery.Tests" />
@@ -24,11 +20,8 @@
2420

2521
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
2622
<PackageReference Include="Microsoft.Bcl.TimeProvider" />
27-
28-
<Reference Include="System.Net.Http" />
29-
30-
<Using Include="System.Net.Http" />
31-
<Using Include="System.Threading.Tasks" />
3223
</ItemGroup>
3324

25+
<Import Project="$(SharedDir)FxPolyfills\FxPolyfills.targets" />
26+
3427
</Project>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
#if NETFRAMEWORK
5+
6+
using System.Diagnostics.CodeAnalysis;
7+
using System.Runtime.CompilerServices;
8+
9+
namespace System;
10+
11+
internal static partial class FxPolyfillArgumentException
12+
{
13+
extension(ArgumentException)
14+
{
15+
public static void ThrowIfNullOrEmpty([NotNull] string? argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null)
16+
{
17+
if (string.IsNullOrEmpty(argument))
18+
{
19+
ThrowNullOrEmptyException(argument, paramName);
20+
}
21+
}
22+
}
23+
24+
[DoesNotReturn]
25+
private static void ThrowNullOrEmptyException(string? argument, string? paramName)
26+
{
27+
ArgumentNullException.ThrowIfNull(argument, paramName);
28+
throw new ArgumentException("The value cannot be an empty string.", paramName);
29+
}
30+
}
31+
32+
#endif
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
#if NETFRAMEWORK
5+
6+
using System.Diagnostics.CodeAnalysis;
7+
using System.Runtime.CompilerServices;
8+
9+
namespace System;
10+
11+
internal static partial class FxPolyfillArgumentNullException
12+
{
13+
extension(ArgumentNullException)
14+
{
15+
public static void ThrowIfNull([NotNull] object? argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null)
16+
{
17+
if (argument is null)
18+
{
19+
Throw(paramName);
20+
}
21+
}
22+
}
23+
24+
[DoesNotReturn]
25+
internal static void Throw(string? paramName) => throw new ArgumentNullException(paramName);
26+
}
27+
28+
#endif

0 commit comments

Comments
 (0)