couchbaselabs / Couchbase.Extensions

Extensions for Couchbase for .Net Core
Apache License 2.0
27 stars 14 forks source link

Can't specify the bucket when using Session and Caching #62

Open dgauerke opened 5 years ago

dgauerke commented 5 years ago

I was trying to use both features and put the data into separate buckets, but it always seems to take the last bucket registered. Here is the sample code that I've tried

        services.AddDistributedCouchbaseCache("WebSessions", opt => { });
        services.AddSession();

        services.AddCouchbaseSession(opt =>
        {
            opt.Cookie.Name = ".Sample.Cookie";
            opt.IdleTimeout = new TimeSpan(0, 0, 20, 0);
        });

        services.AddDistributedCouchbaseCache("WebCache", opt => { });

Is something like this possible? Or can this feature be added? Thanks, David Gauerke

jeffrymorris commented 5 years ago

@dgauerke -

Thanks for sharing - its expected to only use a single bucket for caching. It might be possible to add this in, but would have to look deeper into the details.

-Jeff