title: How to execute manual SQL as part of SaveChanges call in Entity Framework Core?
body: <p>I am looking for a way to add manual raw SQL call to standard AppDbContext interaction. Say I have following code:</p>
  
  <pre><code>Message m = new Message
  {
      Title = message.Title,
      Body = message.Body,
      Date = DateTime.Now,
      Foo = "foo"
  };
  
  _context.Messages.Add(m);
  // Add some manual UPDATE SQL here, like:
  // UPDATE SomeOtherTable SET Foo = 'Something' WHERE SomeComplex = 'Condition'
  
  _context.SaveChanges();
  </code></pre>
  
  <p>The most important thing is to make that manual SQL part of command / transaction that gets created and executed as part of SaveChanges. If there is a way to inject my modification into SQL generated by SaveChanges - that's what I'm looking for.</p>