title: When we Seed a database in ASP.NET MVC, why do we use a lamba expression for returning the id of elements?
body: <p>In all the examples I see, such as </p>
  
  <pre><code>protected override void Seed(BookService.Models.BookServiceContext context)
  {
      context.Authors.AddOrUpdate(x =&gt; x.Id,
          new Author() { Id = 1, Name = "Jane Austen" },
          new Author() { Id = 2, Name = "Charles Dickens" },
          new Author() { Id = 3, Name = "Miguel de Cervantes" }
          );
  
      context.Books.AddOrUpdate(x =&gt; x.Id,
          new Book() { Id = 1, Title = "Pride and Prejudice", Year = 1813, AuthorId = 1, 
              Price = 9.99M, Genre = "Comedy of manners" },
          new Book() { Id = 2, Title = "Northanger Abbey", Year = 1817, AuthorId = 1, 
              Price = 12.95M, Genre = "Gothic parody" },
          new Book() { Id = 3, Title = "David Copperfield", Year = 1850, AuthorId = 2, 
              Price = 15, Genre = "Bildungsroman" },
          new Book() { Id = 4, Title = "Don Quixote", Year = 1617, AuthorId = 3, 
              Price = 8.95M, Genre = "Picaresque" }
          );
  }
  </code></pre>
  
  <p>from <a href="http://www.asp.net/web-api/overview/data/using-web-api-with-entity-framework/part-3" rel="nofollow">here</a>, I see that there is a lamba expression as the first parameter of the <code>AddOrUpdate</code> and it's always shown as the <code>Id</code> (primary key?) of the table. Can someone explain what that lamba expression is for? Is it for checking whether the <code>Id</code> is <code>null</code>? I'm confused. </p>