title: Avoiding the new upsert in Azure Table Storage
body: <p>Steve Marx writes about new extension methods to perform upserts in Azure Table Storage as part of the new storage protocol version here:</p>
  
  <p><a href="http://blog.smarx.com/posts/extension-methods-for-the-august-storage-features" rel="nofollow">http://blog.smarx.com/posts/extension-methods-for-the-august-storage-features</a></p>
  
  <p>However, what if I want to do the original operation of unconditional-merge-or-throw, rather than an upsert. I want to merge an object, updating a single field, but throw if the entity doesn't exist rather than create a new entity that contains only the properties I'm merging.</p>
  
  <p>Is this possible? Note that I want to use upsert elsewhere, so I've taken to having IoC provide me with contexts created from <code>GetDataServiceContext2011</code> instead of <code>GetDataServiceContext</code>. I suppose I could alternate between the two, but that won't help when the Azure team updates the official libraries.</p>
  
  <p>According to <a href="http://msdn.microsoft.com/en-us/library/hh452241.aspx" rel="nofollow">MSDN</a>:</p>
  
  <blockquote>
    <p>The Insert Or Merge Entity operation uses the MERGE verb and must be
    called using the 2011-08-18 version or newer. In addition, it does not
    use the If-Match header. These attributes distinguish this operation
    from the Update Entity operation, though the request body is the same
    for both operations.</p>
  </blockquote>
  
  <p>So, how do I get the storage library to emit a wildcard <code>If-Match</code> on save rather than emit no <code>If-Match</code> at all?</p>