title: Proper way to have an calculated field in EF Code First
body: <p>I referenced this question on SO: </p>
  
  <p><a href="https://stackoverflow.com/questions/5663488/store-read-only-calculated-field-with-entity-framework-code-first">Store read-only calculated field with Entity Framework Code First</a></p>
  
  <p>What they are doing makes sense, but I am trying something a little different and am not sure if my implementation is proper, or if there is any easier way to do this:</p>
  
  <pre><code>public class AffiliateCommission
  {
      public int Id { get; set; }
      public Merchant Merchant { get; set; }
      public AffiliateCommissionType Type { get; set; }
      public string Name { get; set; }
      public string Description { get; set; }
      public int Amount { get; set; }
      public string Status { get; set; }
      public DateTime RecievedDate { get; set; }
      public int TotalPaid { get 
      {
          if (Status == "Paid")
          {
              return this.Amount += this.Amount;
          }
          return 0;
      }
          protected set { }
      }
  
  
      public int TotalUnpaid
      {
          get
          {
              if (Status == "Unpaid")
              {
                  return this.Amount += this.Amount;
              }
              return 0;
          }
          protected set { }
      }
      public int TotalInvoiced
      {
          get
          {
              if (Status == "Invoiced")
              {
                  return this.Amount += this.Amount;
              }
              return 0;
          }
          protected set { }
      }
  }
  </code></pre>
  
  <p>There is going to be a list of AffiliateCommissions, and I want to get the total of all the commissions based off of status. Store it in a different Model maybe? Need some implementation advise.</p>