title: C# - ASP.NET MVC - Convert a List of object , to a List of string, to use in a Session
body: <p>I have that typed List:</p>
  
  <pre><code>IEnumerable&lt;Resource&gt; ResourceAuthorizedForLoggedUser= resourceAuthorizer.FindAll();
  </code></pre>
  
  <p>First a try this, but didn't work:</p>
  
  <pre><code>var authorizations= ResourceAuthorizedForLoggedUser.Select(x =&gt; x.Id).ToString();
  </code></pre>
  
  <p>And I need to put inside that Session:</p>
  
  <pre><code>System.Web.HttpContext.Current.Session["Authorized_List"] = authorizations;
  </code></pre>
  
  <p>To be able to access this data in the base controller</p>
  
  <pre><code>public class BaseController : Controller
  {
     public static List&lt;string&gt; authorizations { get { return Getauthorizations(); } }
  
     private static List&lt;string&gt; Getauthorizations()
     {
        List&lt;string&gt; authorizationsList = (List&lt;string&gt;)System.Web.HttpContext.Current.Session["Authorized_List"];
        return authorizationsList != null &amp;&amp; authorizationsList.Any() ? authorizationsList : new List&lt;string&gt;();
     }
  }
  </code></pre>
  
  <p>And in the end, I get the following error at <code>Getauthorizations</code> method:</p>
  
  <blockquote>
    <p>It is not possible to convert an object of type 'System.String' to type 'System.Collections.Generic.List`1 [System.String]'</p>
  </blockquote>
  
  <p>Any ideas how I can convert that list?</p>