Created
September 17, 2014 03:14
-
-
Save rofr/6a1ab40cb1a5eeb96860 to your computer and use it in GitHub Desktop.
OrigoDB document database commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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