Skip to content

Instantly share code, notes, and snippets.

@rofr
Created September 17, 2014 03:14
Show Gist options
  • Save rofr/6a1ab40cb1a5eeb96860 to your computer and use it in GitHub Desktop.
Save rofr/6a1ab40cb1a5eeb96860 to your computer and use it in GitHub Desktop.
OrigoDB document database commands
[Serializable]
public class PutCommand : Command<DocumentModel>
{
public readonly object Key;
public readonly object Document;
public PutCommand(object key, object document)
{
Key = key;
Document = document;
}
protected override void Execute(DocumentModel model)
{
model.Put(Key, Document);
}
}
[Serializable]
public class RemoveCommand : CommandWithResult<DocumentModel, bool>
{
public readonly object Key;
public RemoveCommand(object key)
{
Key = key;
}
protected override bool Execute(DocumentModel model)
{
return model.Remove(Key);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment