You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public static IServiceCollection AddDeliveryClientCache(this IServiceCollection services, string name, DeliveryCacheOptions options)
it shouldn't really be the responsibility of this SDK to facilitate complex DI resolution scenarios.
Current problems that we see:
not to introduce another NuGet dependency, we are solving the problem with factories which is a workaround for the ASP.NET Core's default DI container
it doesn't solve the problem of nested dependencies completely (scenarios such as using different type providers, link and rich-text resolvers, etc.)
lots of code to maintain and scenarios to be covered with unit tests
Proposed solution
Create an extra NuGet for complex scenarios that would contain more advanced ServiceCollectionExtensions.
Use InternalsVisibleTo to enable access to internal classes from Kentico.Kontent.Delivery (it's a rare use case for that attribute but I think justifiable in this case)
I have been using the SDK over a year now and must say the fact that I can't assigned a custom type provider to a named HttpClient through the .NetCore dependency injection mechanisme represents a real problem on my side.
There is the possibility to create an instance of a SharedTypeProvider class however it only works if all your content types (accross projects) have different names, unfortunately in my case I have content types that share the same name accross projects.
Could we have quick exemple of what solution 4 would look like ? In my case it is very important that I can match a content type provider to a specific named client.
Thanks
The text was updated successfully, but these errors were encountered:
Motivation
Although it's convenient for the consumers and tempting for authors to offer support for registering named services out of the box, e.g.:
public static IServiceCollection AddDeliveryClient(this IServiceCollection services, string name, IConfiguration configuration, string configurationSectionName = "DeliveryOptions")
public static IServiceCollection AddDeliveryClientCache(this IServiceCollection services, string name, DeliveryCacheOptions options)
it shouldn't really be the responsibility of this SDK to facilitate complex DI resolution scenarios.
Current problems that we see:
Proposed solution
ServiceCollectionExtensions
.InternalsVisibleTo
to enable access to internal classes fromKentico.Kontent.Delivery
(it's a rare use case for that attribute but I think justifiable in this case)Additional context
The text was updated successfully, but these errors were encountered: