Skip to content

Instantly share code, notes, and snippets.

@rofr
Created September 17, 2014 03:59
Show Gist options
  • Save rofr/d78202a17709e5d462d8 to your computer and use it in GitHub Desktop.
Save rofr/d78202a17709e5d462d8 to your computer and use it in GitHub Desktop.
Building a CMS with OrigoDB - snippet 4
[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