Skip to content

Commit c9f414e

Browse files
author
Fei Xu
committed
fix:change primary constructor back to explicit constructor to avoid failed build in dotnet 6
1 parent 7d14cce commit c9f414e

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

Diff for: test/Autofac.Extras.DynamicProxy.Test/ServiceMiddlewareInterfaceInterceptorsFixture.cs

+12-3
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,21 @@ public void InterceptsPublicInterfacesUseNoneGenericMethod()
5757
mockDecorator.Verify(e => e.Decorate(), Times.Never);
5858
}
5959

60-
public class Decorator(IPublicInterface decoratedService, IDecoratorInterface decoratorInterface) : IPublicInterface
60+
public class Decorator : IPublicInterface
6161
{
62+
private readonly IPublicInterface _decoratedService;
63+
private readonly IDecoratorInterface _decoratorInterface;
64+
65+
public Decorator(IPublicInterface decoratedService, IDecoratorInterface decoratorInterface)
66+
{
67+
_decoratedService = decoratedService;
68+
_decoratorInterface = decoratorInterface;
69+
}
70+
6271
public string PublicMethod()
6372
{
64-
decoratorInterface.Decorate();
65-
return decoratedService.PublicMethod();
73+
_decoratorInterface.Decorate();
74+
return _decoratedService.PublicMethod();
6675
}
6776
}
6877

0 commit comments

Comments
 (0)