Skip to content

Commit

Permalink
Expose methods outside the assembly
Browse files Browse the repository at this point in the history
  • Loading branch information
waynebrantley authored and khellang committed Feb 8, 2023
1 parent 9150e5e commit 438ad99
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Scrutor/DecorationStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ internal static DecorationStrategy WithType(Type serviceType, Type decoratorType
internal static DecorationStrategy WithFactory(Type serviceType, Func<object, IServiceProvider, object> decoratorFactory) =>
Create(serviceType, decoratorType: null, decoratorFactory);

private protected static Func<IServiceProvider, object> TypeDecorator(Type serviceType, Type decoratorType) => serviceProvider =>
protected static Func<IServiceProvider, object> TypeDecorator(Type serviceType, Type decoratorType) => serviceProvider =>
{
var instanceToDecorate = serviceProvider.GetRequiredService(serviceType);
return ActivatorUtilities.CreateInstance(serviceProvider, decoratorType, instanceToDecorate);
};

private protected static Func<IServiceProvider, object> FactoryDecorator(Type decorated, Func<object, IServiceProvider, object> decoratorFactory) => serviceProvider =>
protected static Func<IServiceProvider, object> FactoryDecorator(Type decorated, Func<object, IServiceProvider, object> decoratorFactory) => serviceProvider =>
{
var instanceToDecorate = serviceProvider.GetRequiredService(decorated);
return decoratorFactory(instanceToDecorate, serviceProvider);
Expand Down
2 changes: 1 addition & 1 deletion src/Scrutor/OpenGenericDecorationStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Scrutor;

internal sealed class OpenGenericDecorationStrategy : DecorationStrategy
public class OpenGenericDecorationStrategy : DecorationStrategy
{
public OpenGenericDecorationStrategy(Type serviceType, Type? decoratorType, Func<object, IServiceProvider, object>? decoratorFactory) : base(serviceType)
{
Expand Down

0 comments on commit 438ad99

Please sign in to comment.