예제 #1
0
 private BranchStepInfo getBranchStepInfo(StepCallback branchStep)
 {
     return(_cachedBranchStepInfos.GetOrAdd(branchStep.Method, (method) =>
     {
         var methodName = method.Name;
         var compensableAttr = MethodUtils.GetDeclaredAttribute <Compensable>(method, typeof(Compensable));
         var branchServiceKey = _sagaResolver.GetServiceKey(method.DeclaringType, methodName);
         var branchCompensationServiceKey = "";
         if (compensableAttr != null)
         {
             var compensationMethodName = (compensableAttr as Compensable).ActionName;
             branchCompensationServiceKey = _sagaResolver.GetServiceKey(method.DeclaringType, compensationMethodName);
         }
         return new BranchStepInfo()
         {
             BranchServiceKey = branchServiceKey,
             BranchCompensationServiceKey = branchCompensationServiceKey
         };
     }));
 }