title: Can a class be returned to the calling method C#?
body: <p>I am new to C# and need some help. I have a ASP.Net page that uses the Session variable in several different methods. The Session variable is a UserInfo class used to store user info between pages. I am trying to have one method creates the userinfo class from the Session and returns it to the calling methods. I am sure it can be done I just can't figure it out. Any help will be greatly appreciated.</p>
  
  <pre><code>private void CheckForUserType()
  {
      var user = RetrieveSession();
  }
  
  private object RetrieveSession()
  {
      var userInfo =(UserInfo)HttpContext.Current.Session["userInfo"];
      return userInfo;
  }
  </code></pre>