Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make AddAWSDynamoDBDistributedCache *only* add and not configure as well #63

Open
rb1n opened this issue Jan 21, 2025 · 2 comments
Open
Labels
feature-request A feature should be added or improved. p2 This is a standard priority issue queued s Effort estimation: small

Comments

@rb1n
Copy link

rb1n commented Jan 21, 2025

The current approach is not ideal when you want to add the services separately to configuring them.

eg it would be useful to be able to configure in one place:

services
    .AddOptions<DynamoDBDistributedCacheOptions>()
    .Configure<IConfiguration>((options, config) => config.GetSection("DynamoDBCache").Bind(options))
    .ValidateDataAnnotations();

// other configuring...

then be able to add the services somewhere else, allowing DI to resolve the options

services.AddAWSDynamoDBDistributedCache();

// add other services...
@ashishdhingra ashishdhingra self-assigned this Jan 21, 2025
@ashishdhingra ashishdhingra added feature-request A feature should be added or improved. p2 This is a standard priority issue investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Jan 21, 2025
@ashishdhingra
Copy link
Contributor

@rb1n Good morning. Thanks for opening the issue. Looks like you are referring to OptionsBuilder API and comparing the implementation to MemoryCacheServiceCollectionExtensions.AddDistributedMemoryCache. For AddDistributedMemoryCache(IServiceCollection), the dependency would be resolved here, where services.AddDistributedMemoryCache() adds singleton instance of MemoryDistributedCache.

I will review this feature request with the team.

Thanks,
Ashish

@ashishdhingra ashishdhingra added s Effort estimation: small needs-review and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Jan 21, 2025
@ashishdhingra ashishdhingra removed their assignment Jan 21, 2025
@ashishdhingra
Copy link
Contributor

@rb1n Good morning. This is a valid feature request based on review with the team.

Following pattern used for MemoryCacheServiceCollectionExtensions.AddDistributedMemoryCache, feel free to contribute PR, if possible. Perhaps we should:

  • Add support for adding DynamoDBDistributedCacheOptions on services.AddOption<T>.
  • Add overload of services.AddAWSDynamoDBDistributedCache() which tries to resolve the options added earlier. May be it will use default options or throw exception if no options were configured earlier (we could decide the implementation).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. p2 This is a standard priority issue queued s Effort estimation: small
Projects
None yet
Development

No branches or pull requests

2 participants