Closed LFDCC closed 2 years ago
ASP.NET Core has heaps of extensibility points, I don't understand why you'd use DynamicProxy.
ASP.NET Core has heaps of extensibility points, I don't understand why you'd use DynamicProxy.
I knew that using Filter would be a better choice I want to know how to solve this problem
ASP.NET Core has heaps of extensibility points, I don't understand why you'd use DynamicProxy.
I don't think any dynamic proxy is as good as the Filter that comes with ASP.NET Core, but I'm just wondering how to implement a proxy in Controller using castle. Core
The CreateClassProxyWithTarget
overload you are using expects a default constructor as documented in the XML documentation:
/// <exception cref = "ArgumentException">Thrown when no parameterless constructor exists on type
/// <paramref name = "classToProxy" />.</exception>
You'll need to use an overload that accepts object[] constructorArguments
.
I want to add a proxy to Controller ,And then I implemented this interface, IControllerActivator , Because my Controller does not have a parameterless constructor, the call CreateClassProxyWithTarget throws the exception. I want to know how to solve this problem