public Type GetDynamicClass(IEnumerable <DynamicProperty> properties)
 {
     rwLock.AcquireReaderLock(Timeout.Infinite);
     try
     {
         Signature signature = new Signature(properties);
         Type      type;
         if (!classes.TryGetValue(signature, out type))
         {
             type = CreateAndCacheDynamicClass(signature);
         }
         return(type);
     }
     finally
     {
         rwLock.ReleaseReaderLock();
     }
 }
Exemplo n.º 2
0
 public Type GetDynamicClass(IEnumerable<DynamicProperty> properties)
 {
     rwLock.AcquireReaderLock(Timeout.Infinite);
     try
     {
         var signature = new Signature(properties);
         if (!classes.TryGetValue(signature, out var type))
         {
             type = CreateDynamicClass(signature.Properties);
             classes.Add(signature, type);
         }
         return type;
     }
     finally
     {
         rwLock.ReleaseReaderLock();
     }
 }