Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NamedDeliveryClientCacheFactory"/> class.
 /// </summary>
 /// <param name="deliveryClientFactory">Factory to be decorated.</param>
 /// <param name="deliveryCacheOptions">Cache configuration options.</param>
 /// <param name="serviceProvider">An <see cref="IServiceProvider"/> instance.</param>
 /// <param name="customServiceProvider">A custom service provider.</param>
 public NamedDeliveryClientCacheFactory(IDeliveryClientFactory deliveryClientFactory, IOptionsMonitor <DeliveryCacheOptions> deliveryCacheOptions, IServiceProvider serviceProvider, INamedServiceProvider customServiceProvider)
 {
     _deliveryCacheOptions       = deliveryCacheOptions;
     _serviceProvider            = serviceProvider;
     _customServiceProvider      = customServiceProvider;
     _innerDeliveryClientFactory = deliveryClientFactory;
 }
 public DeliveryClientCacheFactoryTests()
 {
     _deliveryCacheOptionsMock       = A.Fake <IOptionsMonitor <DeliveryCacheOptions> >();
     _innerDeliveryClientFactoryMock = A.Fake <IDeliveryClientFactory>();
     _autofacServiceProvider         = A.Fake <INamedServiceProvider>();
     _serviceCollection = new ServiceCollection()
                          .AddMemoryCache();
 }
Beispiel #3
0
    public YourController(IDeliveryClientFactory deliveryClientFactory)
    {
        // Creates instances of Delivery clients based on their names
        client1 = deliveryClientFactory.Get("first_project");
        client2 = deliveryClientFactory.Get("second_project");

        // Gets content items from both projects
        // Using the generic <object> produces strongly typed objects based on "system.type"
        var response1 = await client1.GetItemsAsync <object>();

        var response2 = await client2.GetItemsAsync <object>();

        // Merges the responses
        IReadOnlyList <object> items = response1.Items.Concat(response2.Items).ToArray();
    }
Beispiel #4
0
 public BrewersController(IDeliveryClientFactory deliveryClientFactory) : base(deliveryClientFactory)
 {
 }
 public ProductController(IDeliveryClientFactory deliveryClientFactory) : base(deliveryClientFactory)
 {
 }
Beispiel #6
0
 public LanguagesController(IDeliveryClientFactory deliveryClientFactory,
                            ILocalizedRoutingProvider localizedRoutingProvider) : base(deliveryClientFactory)
 {
     _localizedRoutingProvider = localizedRoutingProvider;
 }
Beispiel #7
0
 public CompanyAddressViewComponent(IDeliveryClientFactory deliveryClientFactory)
 {
     DeliveryClient = deliveryClientFactory.Get();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DeliveryClientCacheFactory"/> class.
 /// </summary>
 /// <param name="clientFactory">Factory to be decorated.</param>
 /// <param name="deliveryCacheOptions">Cache configuration options.</param>
 /// <param name="serviceProvider">An <see cref="IServiceProvider"/> instance.</param>
 public DeliveryClientCacheFactory(IDeliveryClientFactory clientFactory, IOptionsMonitor <DeliveryCacheOptions> deliveryCacheOptions, IServiceProvider serviceProvider)
 {
     _innerClientFactory   = clientFactory;
     _deliveryCacheOptions = deliveryCacheOptions;
     _serviceProvider      = serviceProvider;
 }
 public KontentDeliveryService(IConfiguration configuration, IDeliveryClientFactory clientFactory)
 {
     _configuration = configuration;
     _clientFactory = clientFactory;
 }
 public CafesRepository(IDeliveryClientFactory deliveryClientFactory)
 {
     DeliveryClient = deliveryClientFactory.Get();
 }
 public HomeController(IDeliveryClientFactory deliveryClientFactory) : base(deliveryClientFactory)
 {
 }
 public KontentController(IDeliveryClientFactory deliveryClientFactory)
 {
     this.deliveryClientFactory = deliveryClientFactory;
 }
 public CoffeesController(IDeliveryClientFactory deliveryClientFactory) : base(deliveryClientFactory)
 {
 }
Beispiel #14
0
 public SelfConfigController(IDeliveryClientFactory deliveryClientFactory, IWritableOptions <DeliveryOptions> options, IWritableOptions <AppConfiguration> appConfig)
 {
     Options               = options;
     AppConfig             = appConfig;
     DeliveryClientFactory = deliveryClientFactory;
 }
 public ControllerBase(IDeliveryClientFactory deliveryClientFactory) : this()
 {
     _client = deliveryClientFactory.Get();
 }
Beispiel #16
0
 public AboutController(IDeliveryClientFactory deliveryClientFactory) : base(deliveryClientFactory)
 {
 }
Beispiel #17
0
 public ArticlesController(IConfiguration configuration, IDeliveryClientFactory deliveryClientFactory) : base(deliveryClientFactory)
 {
     _configuration = configuration;
 }
 public LanguagesController(IDeliveryClientFactory deliveryClientFactory) : base(deliveryClientFactory)
 {
 }