public ProxyTypeGenerator(IAspectValidatorBuilder aspectValidatorBuilder) { if (aspectValidatorBuilder == null) { throw new ArgumentNullException(nameof(aspectValidatorBuilder)); } _aspectValidator = aspectValidatorBuilder.Build(); _proxyGeneratorUtils = new ProxyGeneratorUtils(); }
public Type CreateClassProxyType(Type serviceType, Type implementationType) { if (serviceType == null) { throw new ArgumentNullException(nameof(serviceType)); } if (!serviceType.GetTypeInfo().IsClass) { throw new ArgumentException($"Type '{serviceType}' should be class.", nameof(serviceType)); } return(ProxyGeneratorUtils.CreateClassProxy(serviceType, implementationType, GetInterfaces(implementationType).ToArray(), _aspectValidator)); }