Skip to content

Instantly share code, notes, and snippets.

@torleifhalseth
Last active August 29, 2015 13:57
Show Gist options
  • Save torleifhalseth/7ea1e95b54ccf102b75b to your computer and use it in GitHub Desktop.
Save torleifhalseth/7ea1e95b54ccf102b75b to your computer and use it in GitHub Desktop.
Mapping Umbraco content to Strongly typed models

###Mapping Umbraco content to Strongly typed models

Every document type in Umbraco should be reflected in a strongly typed model. Example:Article(Document type) --> ArticleModel(Strongly typed model)

Heritage in Umbraco document types should be reflected in our models.

Every view should have an assigned View Model.
Every View Model should inherit from a common view model (CommonViewModel). The common view model should contain global properties. The view model holds content we want to display in our view. This can be content from diffrent models and lists of diffrent model types etc.

####Hijacking Umbraco Routes Every document type should have a controller where the view model is populated and passed to the current template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment