コード例 #1
0
        public ApiClient(IOptions <SquidexOptions> appOptions)
        {
            var options = appOptions.Value;

            var clientManager =
                new SquidexClientManager(options);

            pagesClient = clientManager.CreateContentsClient <Page, PageData>("pages");
            postsClient = clientManager.CreateContentsClient <BlogPost, BlogPostData>("posts");
        }
コード例 #2
0
        public void ConnectToCMS(AppOptions appOptions)
        {
            var options = new SquidexOptions()
            {
                AppName      = appOptions.AppName,
                ClientId     = appOptions.ClientId,
                ClientSecret = appOptions.ClientSecret,
                Url          = appOptions.Url
            };

            clientManager        = new SquidexClientManager(options);
            ledColorsSeqClient   = clientManager.CreateContentsClient <LedColorsSeq, LedColorsSeqData>("cp-led-color-sequence");
            collectionPointsData = clientManager.CreateContentsClient <CollectionPoint, CollectionPointData>("collection-points");
            cpImageAsset         = clientManager.CreateContentsClient <ImageAsset, ImageAssetData>("cp-image-asset");
            cpQuoteAsset         = clientManager.CreateContentsClient <QuoteAsset, QuoteAssetData>("cp-qoute-asset");
        }
コード例 #3
0
        public FeaturesService(IOptions <MyNewsOptions> options)
        {
            if (options.Value.IsConfigured())
            {
                var squidexOptions = new SquidexOptions
                {
                    AppName      = options.Value.AppName,
                    ClientId     = options.Value.ClientId,
                    ClientSecret = options.Value.ClientSecret,
                    Url          = "https://cloud.squidex.io"
                };

                var clientManager = new SquidexClientManager(squidexOptions);

                client = clientManager.CreateContentsClient <NewsEntity, FeatureDto>("feature-news");
            }
        }
コード例 #4
0
ファイル: ApiClient.cs プロジェクト: dcuccia/squidex-samples
        public ApiClient(IOptions <AppOptions> appOptions)
        {
            var options = appOptions.Value;

            var clientManager =
                new SquidexClientManager(
                    options.Url,
                    options.AppName,
                    options.ClientId,
                    options.ClientSecret);

            pagesClient = clientManager.CreateContentsClient <Page, PageData>("pages");
            postsClient = clientManager.CreateContentsClient <BlogPost, BlogPostData>("posts");

            //pagesClient = clientManager.GetClient<Page, PageData>("pages");
            //postsClient = clientManager.GetClient<BlogPost, BlogPostData>("posts");
        }
コード例 #5
0
        public ContentReferencesFixture()
        {
            Task.Run(async() =>
            {
                try
                {
                    await TestEntityWithReferences.CreateSchemaAsync(Schemas, AppName, SchemaName);
                }
                catch (SquidexManagementException ex)
                {
                    if (ex.StatusCode != 400)
                    {
                        throw;
                    }
                }
            }).Wait();

            Contents = ClientManager.CreateContentsClient <TestEntityWithReferences, TestEntityWithReferencesData>(SchemaName);
        }
コード例 #6
0
 public ContentService(IContentsClient contents, ContentManagementOptions options)
 {
     UploadChunkSize   = options.UploadChunkSize;
     downloadChunkSize = options.DownloadChunkSize;
     this.contents     = contents;
 }
コード例 #7
0
 public AuthorImporter(ISession session)
 {
     client = session.Contents <AuthorContent, AuthorData>("author");
 }
コード例 #8
0
 public UserStore(SquidexClientManager clientManager)
 {
     apiClient = clientManager.CreateContentsClient <UserEntity, UserData>("users");
 }
コード例 #9
0
 public UserStore(SquidexClientManagerFactory factory)
 {
     apiClient = factory.GetContentsClient <UserEntity, UserData>("users");
 }