title: The number of primary key values passed must match number of primary key values defined on the entity
body: <p>I've created a view in SQL Server that contains the most important columns from different tables.
  Printing the content of the table to the ASP.NET MVC view works fine, but when I want to get the details of a single record  the problem occur. </p>
  
  <blockquote>
    <p>The number of primary key values passed must match number of primary key values defined on the entity.</p>
  </blockquote>
  
  <p>I navigate to the specific record doing this: </p>
  
  <pre><code>@Html.ActionLink("Details", "Details", new {  id=item.Record_number  })
  </code></pre>
  
  <p>Record number is the primary key. I set this manually by right clicking on the specific variable in the <code>.edmx</code> model. Then I try to get the specific data using the following:</p>
  
  <pre><code>    //
      // GET: /Record/Details/5
      public ActionResult Details(int id = 0)
      {
          try
          {
              RecordDataView record = db.RecordDataView.Find(id); //HERE THE ERROR OCCUR
              if (record == null)
              {
                  return HttpNotFound();
              }
              return View(record);
          }
          catch(EntityException)
          {
              return RedirectToAction("NoDatabaseConnection", "Home");
          }
      }
  </code></pre>
  
  <p>And the model look like this:</p>
  
  <pre><code>namespace Implant.Database
  {
      using System;
      using System.Collections.Generic;
  
      public partial class RecordDataView
      {
          public int Record_number { get; set; }
          public Nullable&lt;System.DateTime&gt; DOB { get; set; }
          public Nullable&lt;System.DateTime&gt; Record_date { get; set; }
  
          /** rest of code omitted */ 
      }
  }
  </code></pre>
  
  <p>At the moment I am using the following code to make it all work. But I don't feel this is a very good way or efficient. And I am very curious how to fix the failure above!</p>
  
  <pre><code>    //
      // GET: /Record/Details/5
      public ActionResult Details(int id = 0)
      {
          var record = from r in db.RecordDataView
                       select r;
          if (id != 0)
          {
              record = record.Where(r =&gt; r.Record_number == id);
          }
          RecordDataView rec = record.ToList().First(); 
  
          return View(rec);   
      }
  </code></pre>
  
  <p>Someone got any idea why this error occurs? Thanks for help! </p>