Skip to content

Commit

Permalink
Remove ActivatorUtilities_In_DependencyInjection #define
Browse files Browse the repository at this point in the history
  • Loading branch information
eerhardt authored and jkotas committed Dec 3, 2020
1 parent 93a70e6 commit 38c6dd7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,17 @@
using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.ExceptionServices;

#if ActivatorUtilities_In_DependencyInjection
using Microsoft.Extensions.Internal;

namespace Microsoft.Extensions.DependencyInjection
#else
namespace Microsoft.Extensions.Internal
#endif
{
/// <summary>
/// Helper code for the various activator services.
/// </summary>

#if ActivatorUtilities_In_DependencyInjection
public
#else
// Do not take a dependency on this class unless you are explicitly trying to avoid taking a
// dependency on Microsoft.AspNetCore.DependencyInjection.Abstractions.
internal
#endif
static class ActivatorUtilities
public static class ActivatorUtilities
{
private static readonly MethodInfo GetServiceInfo =
GetMethodInfo<Func<IServiceProvider, Type, Type, bool, object?>>((sp, t, r, c) => GetService(sp, t, r, c));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,13 @@

using System;

#if ActivatorUtilities_In_DependencyInjection
namespace Microsoft.Extensions.DependencyInjection
#else
namespace Microsoft.Extensions.Internal
#endif
{
/// <summary>
/// Marks the constructor to be used when activating type using <see cref="ActivatorUtilities"/>.
/// </summary>

[AttributeUsage(AttributeTargets.All)]
#if ActivatorUtilities_In_DependencyInjection
public
#else
// Do not take a dependency on this class unless you are explicitly trying to avoid taking a
// dependency on Microsoft.AspNetCore.DependencyInjection.Abstractions.
internal
#endif
class ActivatorUtilitiesConstructorAttribute: Attribute
public class ActivatorUtilitiesConstructorAttribute : Attribute
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<DefineConstants>$(DefineConstants);ActivatorUtilities_In_DependencyInjection</DefineConstants>
<EnableDefaultItems>true</EnableDefaultItems>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,13 @@

using System;

#if ActivatorUtilities_In_DependencyInjection
namespace Microsoft.Extensions.DependencyInjection
#else
namespace Microsoft.Extensions.Internal
#endif
{

/// <summary>
/// The result of <see cref="ActivatorUtilities.CreateFactory(Type, Type[])"/>.
/// </summary>
/// <param name="serviceProvider">The <see cref="IServiceProvider"/> to get service arguments from.</param>
/// <param name="arguments">Additional constructor arguments.</param>
/// <returns>The instantiated type.</returns>
#if ActivatorUtilities_In_DependencyInjection
public
#else
internal
#endif
delegate object ObjectFactory(IServiceProvider serviceProvider, object?[]? arguments);
public delegate object ObjectFactory(IServiceProvider serviceProvider, object?[]? arguments);
}

0 comments on commit 38c6dd7

Please sign in to comment.