public void SetConfiguration(IBookablePairIdTemplate template, SingleIdTemplate <SellerIdComponents> sellerTemplate)
        {
            if (template as BookablePairIdTemplate <TComponents> == null)
            {
                throw new NotSupportedException($"{template.GetType().ToString()} does not match {typeof(BookablePairIdTemplate<TComponents>).ToString()}. All types of IBookableIdComponents (T) used for BookablePairIdTemplate<T> assigned to feeds via settings.IdConfiguration must match those used for RPDEFeedGenerator<T> in settings.OpenDataFeeds.");
            }

            base.SetConfiguration((BookablePairIdTemplate <TComponents>)template, sellerTemplate);
        }
Пример #2
0
        public void SetConfiguration(OpportunityTypeConfiguration opportunityTypeConfiguration, Uri jsonLdIdBaseUrl, int rpdePageSize, IBookablePairIdTemplate template, SingleIdTemplate <SellerIdComponents> sellerTemplate, Uri openDataFeedBaseUrl)
        {
            if (template as BookablePairIdTemplate <TComponents> == null)
            {
                throw new EngineConfigurationException($"{template.GetType().ToString()} does not match {typeof(BookablePairIdTemplate<TComponents>).ToString()}. All types of IBookableIdComponents (T) used for BookablePairIdTemplate<T> assigned to feeds via settings.IdConfiguration must match those used for RPDEFeedGenerator<T> in settings.OpenDataFeeds.");
            }

            if (opportunityTypeConfiguration.SameAs.AbsolutePath.Trim('/') != typeof(TClass).Name)
            {
                throw new EngineConfigurationException($"'{this.GetType().ToString()}' does not have this expected OpenActive model type as generic parameter: '{opportunityTypeConfiguration.SameAs.AbsolutePath.Trim('/')}'");
            }

            base.SetConfiguration((BookablePairIdTemplate <TComponents>)template, sellerTemplate);

            this.RPDEPageSize = rpdePageSize;

            // Allow these to be overridden by implementations if customisation is required
            this.FeedUrl  = FeedUrl ?? new Uri(openDataFeedBaseUrl + opportunityTypeConfiguration.DefaultFeedPath);
            this.FeedPath = FeedPath ?? opportunityTypeConfiguration.DefaultFeedPath;
        }