コード例 #1
0
 public ProxyTypeGenerator(IAspectValidatorBuilder aspectValidatorBuilder)
 {
     if (aspectValidatorBuilder == null)
     {
         throw new ArgumentNullException(nameof(aspectValidatorBuilder));
     }
     _aspectValidator     = aspectValidatorBuilder.Build();
     _proxyGeneratorUtils = new ProxyGeneratorUtils();
 }
コード例 #2
0
 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));
 }