Hello, I created one catalog in CatalogManager and for example 3 nodes/categories (Tea, Coffe, Alcohol). Now I would like to get this categories and their entries and display them in nav as on this page: View So I have a question: is it ok if i will create stored procedure for getting products and using lazy loading display them or is there some other way for getting and displaying products ?
P.S. One more important think: I created MVC Site and I use some Alloy MVC pages.
There are two supported way to get entries from database:
- The first one is using ICatalogSystem and then working with CatalogEntryDto. Note that this approach is considered legacy and for new project we recommend to switch to new approach, as mention below.
- The second one is using content way, via IContentRepository. An introduction can be found here: http://world.episerver.com/Documentation/Items/Developers-Guide/EPiServer-CMS/7/Content/Working-with-IContentRepositoryDataFactory/
With this interface you'll work with CatalogContentBase (base class of all catalog content), Product/VariationContent ...
If you don't have any special which IContentRepository does not support, then I would suggest you to use it instead of creating stored procedures to get entries.
Note that the content way work perfectly with MVC site.
Hi, @Quan Mai I found tutorial how to use CatalogEntryDto sdk episerver example (Browsing Catalogs). I will look to IContentRepository. Thanks a lot !