title: Entity Framework Check if multiple records exist before insert
body: <p>I'm trying to figure out the best way to insert multiple records (over 200) if they do not exist, without making a trip for each record to check if it exists, which I do like this:</p>
  
  <pre><code>foreach (var node in nodes)
  {
      if (!context.Nodes.Any(x =&gt; x.Name == node.Name))
      {
          context.Nodes.Add(new NWatchNode(node));
      }
  
      try
      {
          if (context.Nodes.Local.Any())
          {
              context.SaveChanges();
          }
      }
      catch (Exception ex)
      {
          throw new Exception(ex.Message);
      }
  }
  </code></pre>
  
  <p>What is the best way to do this?</p>