public override void OnConfigure( IDescriptorContext context, IObjectFieldDescriptor descriptor, MemberInfo member) { if (_factoryType != null) { descriptor.UseTransactionScope(_factoryType); } else { descriptor.UseTransactionScope(); } }
/// <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))); }
/// <summary> /// Adds TransactionScope field middleware. /// </summary> public static IObjectFieldDescriptor UseTransactionScope( this IObjectFieldDescriptor descriptor) { return(descriptor.UseTransactionScope <TransactionScopeFactory>()); }