Skip to content

Instantly share code, notes, and snippets.

@fabiomaulo
Created May 10, 2010 14:19
Show Gist options
  • Save fabiomaulo/396085 to your computer and use it in GitHub Desktop.
Save fabiomaulo/396085 to your computer and use it in GitHub Desktop.
under MS-PL
public void Persist(TDataRow dataRow)
{
var entity = Get(dataRow.PartitionKey, dataRow.RowKey);
if (entity != null)
{
var eTag = tableContext.GetEntityDescriptor(entity).ETag;
tableContext.Detach(entity);
tableContext.AttachTo(entityTableName, dataRow, eTag);
tableContext.UpdateObject(dataRow);
}
else
{
tableContext.AddObject(entityTableName, dataRow);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment