title: What is the difference between DbContext.Add() and DbContext.DbSet<TEntity>.Add(TEntity)? When do you use one vs the other?
body: <p>In ms docs <a href="https://docs.microsoft.com/en-us/aspnet/core/data/ef-rp/crud" rel="noreferrer"><strong>Razor pages</strong> tutorial</a> the DbContext has a DbSet Students set</p>
  <pre><code>public class SchoolContext : DbContext
  {
      public DbSet&lt;Student&gt; Students { get; set; }
  </code></pre>
  <p>and in the OnPostAsync() method creates and then adds updated students using <code>DbSet&lt;TEntity&gt;.Add(TEntity)</code> method<a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.dbset-1.add?f1url=https%3A%2F%2Fmsdn.microsoft.com%2Fquery%2Fdev15.query%3FappId%3DDev15IDEF1%26l%3DEN-US%26k%3Dk(Microsoft.EntityFrameworkCore.DbSet%601.Add);k(DevLang-csharp)%26rd%3Dtrue&amp;view=efcore-2.0" rel="noreferrer">(documentation)</a>:</p>
  <pre><code>        var emptyStudent = new Student();
          if (await TryUpdateModelAsync&lt;Student&gt;(
              emptyStudent,
              &quot;student&quot;,   // Prefix for form value.
              s =&gt; s.FirstMidName, s =&gt; s.LastName, s =&gt; s.EnrollmentDate))
          {
              _context.Students.Add(emptyStudent);
              await _context.SaveChangesAsync();
  </code></pre>
  <hr />
  <p>The <a href="https://docs.microsoft.com/en-us/aspnet/core/data/ef-mvc/crud" rel="noreferrer"><strong>MVC tutorial</strong></a> also has a <code>DbContext</code> that has a DbSet Students however in the StudentsController.cs Create() post method, it adds students directly calling <a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.dbcontext.add?f1url=https%3A%2F%2Fmsdn.microsoft.com%2Fquery%2Fdev15.query%3FappId%3DDev15IDEF1%26l%3DEN-US%26k%3Dk(Microsoft.EntityFrameworkCore.DbContext.Add%60%601);k(DevLang-csharp)%26rd%3Dtrue&amp;view=efcore-2.0" rel="noreferrer">DbContext.add()</a> on the DbContext:</p>
  <pre><code>_context.Add(student); 
  await _context.SaveChangesAsync();
  </code></pre>
  <p>The only other difference I see is that in MVC the student was passed in as a parameter:</p>
  <pre><code>public async Task&lt;IActionResult&gt; Create([Bind(&quot;LastName,FirstMidName,EnrollmentDate&quot;)] Student student)
  
      {
  </code></pre>
  <hr />
  <p>Is there any difference between the two? Can they be used interchangeably. When to use one or the other?</p>