public override void OnConfigure(
     IDescriptorContext context,
     IObjectFieldDescriptor descriptor,
     MemberInfo member)
 {
     if (_factoryType != null)
     {
         descriptor.UseTransactionScope(_factoryType);
     }
     else
     {
         descriptor.UseTransactionScope();
     }
 }
Exemple #2
0
 /// <summary>
 /// Adds TransactionScope field middleware.
 /// </summary>
 /// <typeparam name="TFactory">Custom TransactionScope factory class implementing <see cref="ITransactionScopeFactory"/>.</typeparam>
 public static IObjectFieldDescriptor UseTransactionScope <TFactory>(
     this IObjectFieldDescriptor descriptor) where TFactory : ITransactionScopeFactory
 {
     return(descriptor.UseTransactionScope(typeof(TFactory)));
 }
Exemple #3
0
 /// <summary>
 /// Adds TransactionScope field middleware.
 /// </summary>
 public static IObjectFieldDescriptor UseTransactionScope(
     this IObjectFieldDescriptor descriptor)
 {
     return(descriptor.UseTransactionScope <TransactionScopeFactory>());
 }