Episerver provides us developers with loads of useful and extendable APIs. In today's post, I'm going to quickly go over the IContentTypeRepository and how to write some code that will return all of the page types defined in your website.
           var contentTypeRepository = ServiceLocator.Current.GetInstance<IContentTypeRepository>();
           var pageTypeList = contentTypeRepository.List().OfType<PageType>();
You can then use the IContentModelUsage to get a complete usage listing for a particular page type:
          var contentModelUsage = ServiceLocator.Current.GetInstance<IContentModelUsage>();
          var contentRepository = ServiceLocator.Current.GetInstance<IContentRepository>();

          var contentType = contentTypeRepository.Load<ProductPage>();
          var usages = contentModelUsage.ListContentOfContentType(contentType).OrderBy(x => x.Name);