title: Can I implement Entity Framework 5 TPT on Windows XP?
body: <p>Examples of <strong>EF5 Table Per Type</strong> that I have found, such as <a href="http://weblogs.asp.net/manavi/archive/2010/12/28/inheritance-mapping-strategies-with-entity-framework-code-first-ctp5-part-2-table-per-type-tpt.aspx" rel="nofollow noreferrer">this one</a> use the <code>[Table("tablename")]</code> attribute to mark a class as defining a table.</p>
  
  <p>When I add this attribute I get errors:</p>
  
  <pre><code>Error   1   The type or namespace name 'TableAttribute' could not be found (are you missing a using directive or an assembly reference?)    E:\EShared\Syrius6\syrius_syrius\SBD.Syrius.DomainClasses\Classes.cs    599 6   DomainClasses
  Error   2   The type or namespace name 'TableAttribute' could not be found (are you missing a using directive or an assembly reference?)    E:\EShared\Syrius6\syrius_syrius\SBD.Syrius.DomainClasses\Classes.cs    599 6   DomainClasses
  </code></pre>
  
  <p>I have the line</p>
  
  <pre><code> using System.ComponentModel.DataAnnotations;
  </code></pre>
  
  <p>in my namespace</p>
  
  <p>And I am using framework 4 because I want the app to run on Windows XP.</p>
  
  <p>[Update] I had a look at the link flagged as a possible duplicate <a href="https://stackoverflow.com/questions/13340733/cannot-find-entity-framework-4-annotations">here</a>, and as a consequence added a reference to System.Data.Linq and a using System.Data.Linq</p>
  
  <p>The error messages are now </p>
  
  <pre><code> Error  1   The type or namespace name 'TableAttribute' could not be found (are you missing a using directive or an assembly reference?)    E:\EShared\Syrius6\syrius_syrius\SBD.Syrius.DomainClasses\Classes.cs    599 6   DomainClasses
  Error   2   Using the generic type 'System.Data.Linq.Table&lt;TEntity&gt;' requires 1 type arguments  E:\EShared\Syrius6\syrius_syrius\SBD.Syrius.DomainClasses\Classes.cs    599 6   DomainClasses
  </code></pre>
  
  <p>Importantly, I want my code to work on Windows XP , and the second answer to the possible duplicate requires framework 4.5</p>
  
  <p>[Update] Code is as follows;</p>
  
  <pre><code>namespace SBD.Syrius.DomainClasses
  {
   using System;
   using System.Collections.Generic;
   using System.ComponentModel;
   using System.ComponentModel.DataAnnotations;
   using System.Data.Linq;
  
   [Table("Product")]
   public class Product : LoggedEntity
   { 
      [Required]
      public string BuyUnitMeasure { get; set; }
      [Required]
      public Decimal BuyUnitQuantity { get; set; }
      [Required]
      public String Code { get; set; }
      [Required]
      public string Name { get; set; }
      [Required]
      public String SellUnitMeasure { get; set; }
      [Required]
      public Decimal SellUnitQuantity { get; set; }
  
      public virtual Template Template { get; set; }
      [Required]
      public string UnitMeasure { get; set; }
  
  
      public override string ToString()
      {
          return !string.IsNullOrEmpty(this.Name) ? this.Name : "Products";
      }
  
  }
  
   public abstract class LoggedEntity
  {
      public int Id { get; set; }
      public Guid RowId { get; set; }
  
      [ConcurrencyCheck]
      public int RowVersionId { get; set; }
  
      public int SourceSiteNumber { get; set; }
  
   }
  }
  </code></pre>
  
  <p>[Update]</p>
  
  <p>I corrected the using to be
  using System.Data.Linq.Mapping;</p>
  
  <p>Now my error is </p>
  
  <pre><code> System.Data.Linq.Mapping.TableAttribute' does not contain a constructor that takes 1 arguments  
  </code></pre>
  
  <p>[Update]</p>
  
  <p>I also looked at the not accepted answer to the suggested duplicate question.  Which is to use  System.ComponentModel.DataAnnotations  however this requires framework 4.5 and I don't think I can use that because it wont run on Windows XP, and I need to run on XP.</p>
  
  <p>[update]
  <img src="https://i.stack.imgur.com/fR3EI.gif" alt="Here is the screen in Manage Nuget Packages"></p>
  
  <p><img src="https://i.stack.imgur.com/hvB8X.gif" alt="Here is the reference in my project"></p>
  
  <p>I am developing on Windows 7 but the application needs to run on XP.
  I see the example I am trying to follow 
  <a href="http://weblogs.asp.net/manavi/archive/2010/12/28/inheritance-mapping-strategies-with-entity-framework-code-first-ctp5-part-2-table-per-type-tpt.aspx" rel="nofollow noreferrer">Here it is again</a>  uses Framework 4.1 Fluent</p>
  
  <p>My question is Can I use TPT on EF5 to run on Windows XP?
  If so, how?</p>