Learning and user-friendliness will ultimately depend on you and your current skillset, so the term 'best' is going to be quite subjective. I'll throw out a few of my recommendations as well as a few other options worth considering. I would highly recommendlooking into each of them and trying them out to see which works best for you.Consider OrchardI can't recommend the enough.
Kentico Cloud Delivery.NET SDKParadigmPackageDownloadsDocumentationAsyncReactiveSummaryThe Kentico Cloud Delivery.NET SDK is a client library used for retrieving content from Kentico Cloud.You can use it via any of the following NuGet packages:.The first package provides the object to consume Kentico Cloud data via the traditional async way. The second one provides the object that enables the reactive way of consuming the data.The SDK targets the, which means it can be used in.NET Framework 4.6.1 projects and above, and.NET Core 2.0 projects and above.
Kentico has been my go to.NET CMS for nearly 8 years. Over that time I have also implemented nearly a dozen other CMS products for organizations. Through those experiences I still consider Kentico the best.NET CMS offering. They continue to improve on the product and keep the technologies up to date.
Using the DeliveryClientThe IDeliveryClient interface is the main interface of the SDK. Using an implementation of this interface, you can retrieve content from your Kentico Cloud projects.To initialize the client, use the DeliveryClientBuilder class and provide a. // Initializes an instance of the DeliveryClient client by building it with the DeliveryClientBuilder class IDeliveryClient client = DeliveryClientBuilder. WithProjectId( ' '). Build;You can also provide the project ID and other parameters by passing a function that returns the object to the DeliveryClientBuilder.WithOptions method.We recommend creating the DeliveryOptions instance by using the DeliveryOptionsBuilder class.
With the options builder, you can use the following parameters:. ProjectId – sets the ID of your Kentico Cloud project.
This parameter must always be set. UsePreviewApi – determines whether to use the Delivery Preview API and sets the Delivery Preview API key. See to learn more.
![Corey Corey](/uploads/1/2/5/5/125598939/912866149.png)
UseProductionApi – determines whether to use the default production Delivery API. UseSecuredProductionApi – determines whether authenticate requests to the production Delivery API with an API key. See to learn more. WaitForLoadingNewContent – forces the client instance to wait while fetching updated content, useful when acting upon.
EnableResilienceLogic – determines whether HTTP requests will use. By default, the resilience logic is enabled. MaxRetryAttempts – sets a custom number of. By default, the SDK retries requests five times. WithCustomEndpoint - sets a custom endpoint for the specific API (preview, production, or secured production). // Retrieves a list of the specified elements from the first 10 content items of // the 'brewer' content type, ordered by the 'productname' element value DeliveryItemListingResponse response = await client. GetItemsAsync(new EqualsFilter( 'system.type ', 'brewer '),new ElementsParameter( 'image ', 'price ', 'productstatus ', 'processing '),new LimitParameter( 10),new OrderParameter( 'elements.productname ')); Getting localized itemsThe language selection is just a matter of specifying the LanguageParameter parameter with a codename of the required language.
// Retrieves a list of the specified elements from the first 10 content items of // the 'brewer' content type, ordered by the 'productname' element value DeliveryItemListingResponse response = await client. GetItemsAsync(new LanguageParameter( 'es-ES '),new EqualsFilter( 'system.type ', 'brewer '),new ElementsParameter( 'image ', 'price ', 'productstatus ', 'processing '),new LimitParameter( 10),new OrderParameter( 'elements.productname ')); Strongly-typed responsesThe IDeliveryClient also supports retrieving of strongly-typed models. // Retrieving a single content item DeliveryItemResponse response = await client. GetItemAsync( 'latestarticle ');// Retrieving all content items DeliveryItemListingResponse listingResponse = await client. GetItemsAsync;See to learn how to generate models and adjust the logic to your needs. Previewing unpublished contentTo retrieve unpublished content, you need to create an instance of the IDeliveryClient with both Project ID and Preview API key. Each Kentico Cloud project has its own Preview API key.
// Note: We recomend that you work with only either the production OR preview Delivery API within a single project. IDeliveryClient client = DeliveryClientBuilder. WithOptions( builder = builder. WithProjectId( ' '). UsePreviewApi( ' ').
Build;Learn more about in our Developer Hub. Response structureFor full description of single and multiple content item JSON response formats, see our. Single content item responseWhen retrieving a single content item, you get an instance of the DeliveryItemResponse class. This class represents the JSON response from the Delivery API endpoint and contains the requested ContentItem as a property. Multiple content items responseWhen retrieving a list of content items, you get an instance of the DeliveryItemListingResponse.
String assetUrl = articleItem. GetAssets( 'teaserimage '). Url;ImageUrlBuilder builder = new ImageUrlBuilder( assetUrl);string transformedAssetUrl = builder. WithFocalPointCrop( 560, 515, 2). WithAutomaticFormat( ImageFormat. WithCompression( ImageCompression. WithQuality( 85).
Url;For list of supported transformations and more information visit the Kentico Delivery API reference at. Resilience capabilitiesBy default, the SDK uses a retry policy, asking for requested content again in case of an error. You can disable the retry policy by setting the DeliveryOptions.EnableResilienceLogic parameter to false. The default policy retries the HTTP requests if the following status codes are returned:. 408 - RequestTimeout.
500 - InternalServerError. 502 - BadGateway. 503 - ServiceUnavailable. 504 - GatewayTimeoutThe default policy retries requests 5 times, totaling 6 overall attempts to retrieve content before throwing a DeliveryException. You can configure the number of attempts using the DeliveryOptions.MaxRetryAttempts property.
The consecutive attempts are delayed exponentially: 400 milliseconds, 800 milliseconds, 1600 milliseconds, etc.The default resilience policy is implemented using. You can also implement your own Polly policy wrapped in an IResiliencePolicyProvider instance. The instance can be set to IDeliveryClient implementation through the DeliveryClientBuilder class or by registering it to the ServiceCollection. Using the KenticoCloud.Delivery.Rx reactive libraryThe provides a reactive way of retrieving Kentico Cloud content.The DeliveryObservableProxy class constructor accepts an instance, therefore you are free to create the IDeliveryClient implementation (or its derivatives) in any of. IObservable articlesWithBaristaPersona = DeliveryObservableProxy.
GetItemsObservable( new ContainsFilter( 'elements.personas ', 'barista '));Unlike most of the IDeliveryClient methods that return data wrapped in Delivery.Response objects, their.Observable counterparts always return sequences of the Kentico Cloud artifacts themselves (not wrapped). Should an error response be returned by the IDeliveryClient implementation, the observable sequence will terminate with the conventional call.
Using for debuggingThis repository is configured to generate a SourceLink tag in the NuGet package that allows debugging this repository's source code when it is referenced as a Nuget package. The source code is downloaded directly from GitHub to Visual Studio.