title: Check if Record Exists in Entity Framework
body: <p>Could somebody please tell me how I check to see if a record exists, if it does exists then do nothing and if it doesn't then add the record to the database?</p>
  
  <p>Please see my code below:</p>
  
  <pre><code>if (isIpnValidated == true)
  {
      using (WebApplication1Entities db = new WebApplication1Entities())
      {
          Orders order = new Orders();
          order.UserId = userId;
          order.Date = System.DateTime.Now;
          order.Transaction = txnId;
          order.Amount = Convert.ToDecimal(mcGross);
          order.Email = payerEmail;
          order.Country = residenceCountry;
  
          db.Orderss.Add(order);
          db.SaveChanges();
      }
  }
  </code></pre>
  
  <p>I just want to ensure no possible duplication in the database.</p>