Amnesia.SessionTracker.AssertActivityStarted C# (CSharp) Méthode

AssertActivityStarted() public méthode

Throws an exception if the current thread is not tied to an activity
public AssertActivityStarted ( ) : void
Résultat void
        public void AssertActivityStarted()
        {
            if (CurrentThreadActivity == null)
            {
                if (HttpContext.Current != null)
                    throw new InvalidOperationException("The web request is not associated with the Amnesia session.  Call Session.StartActivity() first.");

                throw new InvalidOperationException("Thread " + Thread.CurrentThread.ManagedThreadId + " (" + Thread.CurrentThread.Name + ") is not associated with the Amnesia session.   Call Session.StartActivity() first.");
            }
        }