title: Arbitrary Assignment in Method
body: <p>I was looking through the internals of <a href="https://github.com/aspnet/EntityFrameworkCore/blob/dev/src/EFCore/Internal/InternalDbSet.cs" rel="nofollow noreferrer">DbSet</a> when I came across some wierd code:</p>
  
  <pre><code>private void CheckState()
  {
      // ReSharper disable once AssignmentIsFullyDiscarded
      _ = EntityType;
  }
  </code></pre>
  
  <p>Note _ is not declare anywhere they are using the new C# 7.0 Discard operator.  Why would someone want to do something like this?  Is there any benefit of doing this?</p>
  
  <p><strong>Edit</strong> </p>
  
  <pre><code>private IEntityType EntityType
      {
          get
          {
              _context.CheckDisposed();
  
              if (_entityType != null)
              {
                  return _entityType;
              }
  
              _entityType = _context.Model.FindEntityType(typeof(TEntity));
  
              if (_entityType == null)
              {
                  throw new InvalidOperationException(CoreStrings.InvalidSetType(typeof(TEntity).ShortDisplayName()));
              }
  
              return _entityType;
          }
      }
  </code></pre>