Created
September 17, 2014 03:59
-
-
Save rofr/d78202a17709e5d462d8 to your computer and use it in GitHub Desktop.
Building a CMS with OrigoDB - snippet 4
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 RemovePageCommand : Command<CmsModel> | |
{ | |
public readonly Guid PageId; | |
public RemovePageCommand(Guid pageId) | |
{ | |
PageId = pageId; | |
} | |
protected override void Execute(CmsModel model) | |
{ | |
try | |
{ | |
model.RemovePage(PageId); | |
} | |
catch (InvalidOperationException) | |
{ | |
throw new CommandFailedException("No such pageId"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment