Skip to content

Instantly share code, notes, and snippets.

@rofr
Created September 17, 2014 03:57
Show Gist options
  • Save rofr/a7e287063d23219af8bf to your computer and use it in GitHub Desktop.
Save rofr/a7e287063d23219af8bf to your computer and use it in GitHub Desktop.
Building a CMS with OrigoDB - snippet 2
[Serializable]
public class CmsModel : Model
{
private IDictionary<Guid, Page> _pages;
public CmsModel()
{
_pages = new Dictionary<Guid, Page>();
}
public void RemovePage(Page page)
{
if (!_pages.ContainsKey(page.Id)) throw new InvalidOperationException();
_pages.Remove(page.Id);
}
public void PutPage(Page page)
{
_pages[page.Id] = page;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment