title: Based on a Linq join I get the error A second operation started on this context before a previous operation completed
body: <p>The following code uses dbcontext. </p>
  
  <pre><code>var CurrentUser = await userManager.GetUserAsync(User);
  var DefaultLanguageID = CurrentUser.DefaultLangauge;
  
  var TestForNull = (from c in _classificationLevel.GetAllClassificationLevels()
    join l in _classificationLevelLanguage.GetAllClassificationLevelLanguages()
    on c.Id equals l.ClassificationLevelId
    where c.ClassificationId == NewLevel.SuObject.ObjectId
    &amp;&amp; l.LanguageId == DefaultLanguageID
    select c.Sequence).Count();
  </code></pre>
  
  <p>While running it, I get the error the error </p>
  
  <pre><code>A second operation started on this context before a previous operation completed.
  </code></pre>
  
  <p>I am not sure why. I can imagine that the first operation is:
  userManager.GetUserAsync(User);</p>
  
  <p>and is still running while the next starts. Though it has the keyword await in front.</p>
  
  <p>The other option I thought is that within the query two tables are retrieved and that it uses for both the same dbcontext. 
  1. _classificationLevel.GetAllClassificationLevels()
  2. _classificationLevelLanguage.GetAllClassificationLevelLanguages()</p>
  
  <p>Is this the reason for the error?</p>
  
  <p>The methods behind these are:</p>
  
  <pre><code>public IEnumerable&lt;SuClassificationLevelModel&gt; GetAllClassificationLevels()
  {
      return context.dbClassificationLevel.AsNoTracking();
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>public IEnumerable&lt;SuClassificationLevelLanguageModel&gt; GetAllClassificationLevelLanguages()
  {
      return context.dbClassificationLevelLanguage;
  }
  </code></pre>
  
  <p>I don't have an async / await on these. Should I and if so, how should I do that?</p>
  
  <p>On a model level, the two models are related as shown in the code below:</p>
  
  <pre><code>public interface IClassificationAndStatusRepository
  {
      IEnumerable&lt;SuObjectVM&gt; GetAllClassifications();
      IEnumerable&lt;SuClassificationStatusModel&gt; GetAllStatus();
  }
  </code></pre>