Wednesday, May 11, 2016

EPiServer - Basic Get Pages Content and blocks



Loading multiple instances

It is also possible to load several content instances at the same time by calling 
GetItems<T> where T : IContentData 
(corresponds to GetPages in previous versions). Below is an example on GetItems:
IEnumerable<ContentReference> references = GetSomeReferences();
IEnumerable<IContent> items = Locate.ContentRepository()
.GetItems<IContent>(references, LanguageSelector.AutoDetect());



Very useful article:
http://world.episerver.com/Blogs/Johan-Bjornfot/Dates1/2012/8/EPiServer7-Working-with-IContentRepositoryDataFactory/

No comments:

Post a Comment