title: Recieving an Invalid casting error mvc app -- fails on unrelated line
body: <p>I have an MVC application that uses Code-First migrations. I'm receiving the following cast error : 'The specified cast from a materialized </p>
  
  <blockquote>
    <p>'System.Int32' type to the 'System.Guid' type is not valid.'</p>
  </blockquote>
  
  <p>The app fails immediately somewhere in here:</p>
  
  <pre><code>if (!User.Identity.IsAuthenticated)
          {
              ViewBag.ProfilePicture = "../Assets/cow.jpg";
              Session["backColor"] = "#B40404";
              if (db.Information.Count() != 0)
              {
  </code></pre>
  
  <p>So, given where the IDE says it's failing, the error it's sending, Anyone have any ideas? Thanks in advance!</p>
  
  <p>here's the stack trace: </p>
  
  <blockquote>
    <p>[InvalidOperationException: The specified cast from a materialized 'System.Int32' type to the 'System.Guid' type is not valid.]
       System.Data.Entity.Core.Common.Internal.Materialization.ErrorHandlingValueReader<code>1.GetValue(DbDataReader reader, Int32 ordinal) +235
       lambda_method(Closure , Shaper ) +258
       System.Data.Entity.Core.Common.Internal.Materialization.Coordinator</code>1.ReadNextElement(Shaper shaper) +182
       System.Data.Entity.Core.Common.Internal.Materialization.SimpleEnumerator.MoveNext() +78
       System.Data.Entity.Internal.LazyEnumerator<code>1.MoveNext() +112
       System.Collections.Generic.List</code>1..ctor(IEnumerable<code>1 collection) +275
       System.Linq.Enumerable.ToList(IEnumerable</code>1 source) +58
       WisconsinTrackClubWebsite.Controllers.HomeController.Index() in C:\Users\RunFranks525\Documents\Workspace\witrackclub\WisconsinTrackClubWebsite\Controllers\HomeController.cs:29
       lambda_method(Closure , ControllerBase , Object[] ) +62
       System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
       System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary<code>2 parameters) +157
       System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary</code>2 parameters) +27
       System.Web.Mvc.Async.AsyncControllerActionInvoker.b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +22
       System.Web.Mvc.Async.WrappedAsyncResult<code>2.CallEndDelegate(IAsyncResult asyncResult) +29
       System.Web.Mvc.Async.WrappedAsyncResultBase</code>1.End() +49
       System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +32
       System.Web.Mvc.Async.AsyncInvocationWithFilters.b__3d() +50
       System.Web.Mvc.Async.&lt;>c__DisplayClass46.b__3f() +225
       System.Web.Mvc.Async.&lt;>c__DisplayClass33.b__32(IAsyncResult asyncResult) +10
       System.Web.Mvc.Async.WrappedAsyncResult<code>1.CallEndDelegate(IAsyncResult asyncResult) +10
       System.Web.Mvc.Async.WrappedAsyncResultBase</code>1.End() +49
       System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34
       System.Web.Mvc.Async.&lt;>c__DisplayClass2b.b__1c() +26
       System.Web.Mvc.Async.&lt;>c__DisplayClass21.b__1e(IAsyncResult asyncResult) +100
       System.Web.Mvc.Async.WrappedAsyncResult<code>1.CallEndDelegate(IAsyncResult asyncResult) +10
       System.Web.Mvc.Async.WrappedAsyncResultBase</code>1.End() +49
       System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27
       System.Web.Mvc.Controller.b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +13
       System.Web.Mvc.Async.WrappedAsyncVoid<code>1.CallEndDelegate(IAsyncResult asyncResult) +29
       System.Web.Mvc.Async.WrappedAsyncResultBase</code>1.End() +49
       System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +36
       System.Web.Mvc.Controller.b__15(IAsyncResult asyncResult, Controller controller) +12
       System.Web.Mvc.Async.WrappedAsyncVoid<code>1.CallEndDelegate(IAsyncResult asyncResult) +22
       System.Web.Mvc.Async.WrappedAsyncResultBase</code>1.End() +49
       System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +26
       System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
       System.Web.Mvc.MvcHandler.b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +21
       System.Web.Mvc.Async.WrappedAsyncVoid<code>1.CallEndDelegate(IAsyncResult asyncResult) +29
       System.Web.Mvc.Async.WrappedAsyncResultBase</code>1.End() +49
       System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +28
       System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9765121
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +155</p>
  </blockquote>