redis-om-dotnet icon indicating copy to clipboard operation
redis-om-dotnet copied to clipboard

.AsStateless() / .AsStateful() real-time toggle..

Open VagyokC4 opened this issue 1 year ago • 2 comments

@slorello89 Is it possible to have a fluent call that can enable / disable at invocation time?

var collection = redisConnectionProvider.RedisCollection<T>();
var itemsWithoutState = await collection.AsStateless().Where(x=>x.IsTrue == true).ToListAsync();
var itemsWithState = await collection.AsStateful().Where(x=>x.IsTrue == true).ToListAsync();

Or something to that effect?

I do like the idea of setting them up defaulting to stateless on the collection, but I can see there may be time in the future when I want to use the state, and can see utility in being able to override the switch on demand on a per query basis.

VagyokC4 avatar Sep 15 '22 19:09 VagyokC4

Yeah, as I mentioned in the other issue I'm not certain about adding this (think it adds unnecessary complexity). As it stands right now. Let's leave this open and see if anyone else wants it.

slorello89 avatar Sep 19 '22 10:09 slorello89

Yeah, as I mentioned in the other issue I'm not certain about adding this (think it adds unnecessary complexity). As it stands right now. Let's leave this open and see if anyone else wants it.

No worries. I can do this on my side with a .Stateless() and .Stateful() that wire up accordingly. As I mentioned earlier, I'm not using state at the moment, so we can let this marinate and see if anybody else wants it :)

VagyokC4 avatar Sep 19 '22 17:09 VagyokC4