Skip to content

Accessing content revisions from the database

Simon Yohannes edited this page Nov 30, 2019 · 5 revisions

your ViewModels are saved in the database, in the PuckRevision table. to work with revisions from the database, you can inject I_Puck_Repository into your controller or work directly with the entity framework context, PuckContext. the puck repository has many useful methods for retrieving content and i may get around to documenting them but for now you can view the source code for the available methods Puck_Repository.

note that the repository returns the entity PuckRevision. you can obtain your original ViewModel from a PuckRevision by doing the following:

var homepage = homepageRevision.ToBaseModel() as Homepage;