protected T InvokeWithAPILogging <T>(Func <T> action, [CallerMemberName] string memberName = null)
 {
     return(ADScenarioLog.InvokeWithAPILog <T>(DateTime.UtcNow, memberName, default(Guid), this.Implementor, "", () => action(), delegate
     {
         TSession session = this.GetSession();
         return session.LastUsedDc;
     }));
 }
Example #2
0
        private static T InvokeWithAPILogging <T>(Func <T> action, [CallerMemberName] string memberName = null) where T : ADSessionSettings
        {
            Func <string> func = null;

            if (ADSessionSettings.SessionSettingsFactory.Default is ADSessionSettingsFactory)
            {
                DateTime utcNow     = DateTime.UtcNow;
                Guid     activityId = default(Guid);
                string   className  = ADSessionSettings.ClassName;
                string   caller     = "";
                Func <T> action2    = () => action();
                if (func == null)
                {
                    func = (() => null);
                }
                return(ADScenarioLog.InvokeWithAPILog <T>(utcNow, memberName, activityId, className, caller, action2, func));
            }
            return(action());
        }