Created
September 17, 2014 03:57
-
-
Save rofr/a7e287063d23219af8bf to your computer and use it in GitHub Desktop.
Building a CMS with OrigoDB - snippet 2
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 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