title: Error - model sent to the view is incorrect
body: <p>I am getting following error message.Could somebody tell me why I am getting the following error message. My model is getting initialized with values when I debug the controller.</p>
  
  <pre><code>The model item passed into the dictionary is of type 'AngularJSMvcExample.Models.RegistrationVm', but this dictionary requires a model item of type 'System.String'.
  </code></pre>
  
  <p>My model code</p>
  
  <pre><code>namespace AngularJSMvcExample.Models
  {
      public class RegistrationVm
      {
          public string Courses { get; set; }
          public string Instructors { get; set; }
      }
  }
  </code></pre>
  
  <p>My Controller code</p>
  
  <pre><code>namespace AngularJSMvcExample.Controllers
  {
      public class RegistrationController : Controller
      {
  
          private RegistrationVmBuilder _registrationVmBuilder = new RegistrationVmBuilder();
          // GET: Registration
          public ActionResult Index()
          {
              return View(_registrationVmBuilder.BuildRegistrationVm());
          }
      }
  }
  </code></pre>
  
  <p>My ViewCode</p>
  
  <pre><code>@model AngularJSMvcExample.Models.RegistrationVm
  
  @{
      ViewBag.Title = "Registration";
      Layout = "~/Views/Shared/_Layout.cshtml";
  }
  
  &lt;div class="container" ng-controller="RegistrationController"&gt;
  
      &lt;div class="row"&gt;
          &lt;div class="navbar navbar-default"&gt;
              &lt;div class="navbar-header"&gt;
                  &lt;ul class="nav navbar-nav"&gt;
                      &lt;li&gt;
                          &lt;span class="navbar-brand"&gt;Registration&lt;/span&gt;
                      &lt;/li&gt;
  
                  &lt;/ul&gt;
  
              &lt;/div&gt;
              &lt;div class="navbar-collapse collapse"&gt;
                  &lt;ul class="nav nav-bar"&gt;
                      &lt;li &gt;&lt;a href="/Courses"&gt;Browse Catalog&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="/Instructors"&gt;Browse Instructors&lt;/a&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>My RegistrationVmBuilder code</p>
  
  <pre><code>namespace AngularJSMvcExample.Models
  {
      public class RegistrationVmBuilder
      {
  
          public RegistrationVm BuildRegistrationVm()
          {
              var registrationVm = new RegistrationVm
              {
                  Courses = GetSerialisedCourse(),
                  Instructors = GetSerialisedInstructors()
  
              };
              return registrationVm;
          }
  
          public string GetSerialisedCourse()
          {
              var courses = new[]
              {
                  new CourseVm {Number= "100", Name= "Physis", Instructor = "Jan"},
                  new CourseVm {Number= "101", Name= "Chemistry", Instructor = "Sal"},
                  new CourseVm {Number= "102", Name= "Biology", Instructor = "San"},
                  new CourseVm {Number= "103", Name= "History", Instructor = "Jack"},
                  new CourseVm {Number= "104", Name= "Maths", Instructor = "Rahul"}
  
              };
              var settings = new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() };
              var serializeCourses =  JsonConvert.SerializeObject(courses, settings);
              return serializeCourses;
          }
  
          public string GetSerialisedInstructors()
          {
              var instructors = new[]
              {
                  new InstructorsVm {Name= "Jan", Email= "jan.test@test.com", Roomno = "10"},
                  new InstructorsVm {Name= "Pal", Email= "pal.test@test.com", Roomno = "9"},
                  new InstructorsVm {Name= "San", Email= "san@test.com", Roomno = "11"},
                  new InstructorsVm {Name= "Jack", Email= "jack@test@test.com", Roomno = "12"},
                  new InstructorsVm {Name= "Rahul", Email= "rahul@test@test.com", Roomno = "15"}
  
              };
              var settings = new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() };
              var serializeInstructors = JsonConvert.SerializeObject(instructors, settings);
              return serializeInstructors;
          }
      }
  }
  </code></pre>