title: What is the return value of Database.ExecuteSqlCommand?
body: <p>Modifying an answer from <a href="https://stackoverflow.com/questions/23916453/how-can-i-use-use-entity-framework-to-do-a-merge-when-i-dont-know-if-the-record">this question</a> slightly, suppose I run this code:</p>
  
  <pre><code>public int SaveOrUpdate(MyEntity entity)
  {
      var sql =  @"MERGE INTO MyEntity
                  USING 
                  (
                     SELECT   @id as Id
                              @myField AS MyField
                  ) AS entity
                  ON  MyEntity.Id = entity.Id
                  WHEN MATCHED THEN
                      UPDATE 
                      SET     Id = @id
                              MyField = @myField
                  WHEN NOT MATCHED THEN
                      INSERT (Id, MyField)
                      VALUES (@Id, @myField);"
  
      object[] parameters = {
          new SqlParameter("@id", entity.Id),
          new SqlParameter("@myField", entity.myField)
      };
      return context.Database.ExecuteSqlCommand(sql, parameters);
  }
  </code></pre>
  
  <p>This will actually run and it returns an int. What does the int mean? The <a href="https://msdn.microsoft.com/en-us/library/system.data.entity.database.executesqlcommand(v=vs.113).aspx" rel="nofollow noreferrer">documentation</a> just says </p>
  
  <blockquote>
    <p>The result returned by the database after executing the command.</p>
  </blockquote>
  
  <p>I did a couple tests and it looks like it's 1 if it modified a row, and 0 if nothing changed. Is the return value the number of rows modified?</p>