title: Getting An Entity with Key (PK) will not round-trip when: when using a view
body: <p>I have looked through the other questions on this topic, most of which mention editing the edmx file. I am working in Visual Studio Express 2015 and cannot find any edmx file, nor can I figure out what/where the error is referencing. The error is being generated when I go to a page that is not even tied to the view in question.
  Originally I used a view with case statements, then changed to a view using union statement, then took the subquery and made it a separate view. Out of ideas on why the error is occuring. The offending columns are the four image columns. UPDATE: Changed the underlying datatables and changed all the forms underneath to use the new tables, only requires on view now to obtain all objects. Tables have foreign key relationship defined between them. New View below:</p>
  
  <p>View 1:</p>
  
  <pre><code>CREATE VIEW [dbo].[V_Questions]
  AS SELECT Questions.QuestionID Id, Author, ImageFile, Image1Content, Image1Name, 
  ImageFile2, Image2Content, Image2Name, ImageFile3, Image3Content, Image3Name, 
  ImageFile4, Image4Content, Image4Name, SubmitDate, Stem, RespA, RespB, RespC, RespD, RespE, Answer, Critique, KeyObjective, [References], PracticeArea1,PracticeArea2,  PracticeArea3, PracticeArea4, IsCloneOf
  FROM [Questions] 
  Left join Images on Questions.ImageID = Images.ImageID
  </code></pre>
  
  <p>Error Msg (basically unchanged, line numbers have changed, but still issues with the four image files.:</p>
  
  <blockquote>
    <p>Server Error in '/' Application.</p>
    
    <p>(74,10) : error 3004: Problem in mapping fragments starting at line<br>
    74: No mapping specified for properties V_Question. ImageFile, 
    V_Question.ImageFile2, V_Question.ImageFile3, V_Question.ImageFile4 in
    Set V_Question. An Entity with Key (PK) will not round-trip when:
    Entity is type [cs1.Models.V_Question]</p>
  </blockquote>
  
  <p>Think I have figured out the file being complained about (V_Question.designer.cs) as line 74 Starts the definitions for the view.
  Here is that file starting on line 74 and up to/including the first imagefile record, how can I fix this?:</p>
  
  <pre><code>[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.V_Questions")]
  public partial class V_Question
  {
  
      private int _Id;
  
      private string _Author;
  
      private System.Data.Linq.Binary _ImageFile;
  
      private string _Image1Content;
  
      private string _Image1Name;
  
      private System.Data.Linq.Binary _ImageFile2;
  
      private string _Image2Content;
  
      private string _Image2Name;
  
      private System.Data.Linq.Binary _ImageFile3;
  
      private string _Image3Content;
  
      private string _Image3Name;
  
      private System.Data.Linq.Binary _ImageFile4;
  
      private string _Image4Content;
  
      private string _Image4Name;
  
      private string _SubmitDate;
  
      private string _Stem;
  
      private string _RespA;
  
      private string _RespB;
  
      private string _RespC;
  
      private string _RespD;
  
      private string _RespE;
  
      private string _Answer;
  
      private string _Critique;
  
      private string _KeyObjective;
  
      private string _References;
  
      private string _PracticeArea1;
  
      private string _PracticeArea2;
  
      private string _PracticeArea3;
  
      private string _PracticeArea4;
  
      private int _IsCloneOf;
  
      public V_Question()
      {
      }
  
      [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", DbType="Int NOT NULL")]
      public int Id
      {
          get
          {
              return this._Id;
          }
          set
          {
              if ((this._Id != value))
              {
                  this._Id = value;
              }
          }
      }
  
      [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Author", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
      public string Author
      {
          get
          {
              return this._Author;
          }
          set
          {
              if ((this._Author != value))
              {
                  this._Author = value;
              }
          }
      }
  
      [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ImageFile", DbType="VarBinary(MAX)", UpdateCheck=UpdateCheck.Never)]
      public System.Data.Linq.Binary ImageFile
      {
          get
          {
              return this._ImageFile;
          }
          set
          {
              if ((this._ImageFile != value))
              {
                  this._ImageFile = value;
              }
          }
      }
  </code></pre>