title: ASP.NET 5 (Core): How to store objects in session-cache (ISession)?
body: <p>I am writing an ASP.NET 5 MVC 6 (Core) application. Now I came to a point where I need to store (set and get) an object in the session-cache (<code>ISession</code>).</p>
  
  <p>As you may know, the <code>Set</code>-method of <code>ISession</code> takes a <code>byte-array</code> and the <code>Get</code>-method returns one.</p>
  
  <p>In a non-core-application I would use the <code>BinaryFormatter</code> to convert my object. But how can I do it in a core-application?</p>