title: Changing a Guid variable when user is admin
body: <p>I'm building out a quick prototype app that has two hardcoded users with test data a patient user and an admin. New users can also be created but will not have any data to display they can only add. I have a situation where I call a method that takes in a Guid as a parameter. When the user is admin I want to pass in a hardcoded Guid for the pre existing patient user, When not admin I want to base it off the Guid attached to the user session, below is my razor code which is currently not working. </p>
  
  <pre><code>Guid patientID = new Guid("3aac8d07-ad35-e311-8bdf-9ebf7757768f");
  
  @if(userSession.IsAdmin == "TRUE")
  {
      System.Data.DataSet ds = MeasuredHealthBeta1.Utilities.DataHelper.Measurements_Get306060DayGlucoseMeasurements(patientID );
  }
  else
  {
      System.Data.DataSet ds = MeasuredHealthBeta1.Utilities.DataHelper.Measurements_Get306060DayGlucoseMeasurements(userSession.UserIDNative);
  }
  </code></pre>
  
  <p>The error "External component has thrown an exception" occurring is when the view containing this razor code goes to get loaded using the following method</p>
  
  <pre><code> @{Html.RenderPartial("../Metrics/ReportsHistoryList", Model, new ViewDataDictionary(this.ViewData) { { "MeasurementTypeGroupIDs", defaultMeasurementTypeIDs } });}  
  </code></pre>