Comments (4)
Hi 'GetTypedClient<TPocoType>' is only for complex types i.e. POCO's.
When you call 'Store' from a 'GetTypedClient<TPocoType>()' client, then the key
its stored against is actually 'urn:DTOb:4'. Basically it uses
'IdUtils.CreateUrn<T>()' to determine the key.
So the problem is you're not expiring the same key, i.e. '4' != 'urn:DTOb:4'
Now there is a 'IRedisTypedClient<T>.SetEntry(string key, T value, TimeSpan
expireIn);' where you can specify the key the value is stored against as well
as expire it in a single call.
I can see why its confusing though, although if the method includes the word
'Id' in the name (e.g. GetById) then its just expecting the 'Id' field (i.e.
'4') for all other methods with a 'key' field, its expecting the full key (i.e.
urn:DTOb:4).
Hope this helps.
- Demis
Original comment by [email protected]
on 14 Jul 2010 at 11:22
from servicestack.
so when I do SetEntry(), key property should be 4 or urn:DTOb:4 ?
Original comment by [email protected]
on 15 Jul 2010 at 2:01
from servicestack.
Actually in that case, the key can be anything you want it to be. By convention
I would use 'IdUtils.CreateUrn<T>()' to create the key since it is less likely
to collide with other types that share the same Id value and you should then be
able to use other methods (i.e. GetById, etc).
The problem with the current design (that you've highlighted here) is that I've
left some operations on IRedisTypedClient that are not specifically catered for
accessing POCO types.
'IRedisTypedClient<T>.SetEntry(string key, T value, TimeSpan expireIn);'
should really have been:
'IRedisTypedClient<T>.SetEntry(T value, TimeSpan expireIn);'
In which I would've extracted the key automatically for you.
It looks like I'm going to need to go through the 'IRedisTypedClient' interface
and re-factor the methods to make them all a perfect fit.
- Demis
Original comment by [email protected]
on 15 Jul 2010 at 7:35
from servicestack.
Original comment by [email protected]
on 28 Aug 2010 at 5:25
- Changed state: Fixed
from servicestack.
Related Issues (20)
- Serializing byte[] cannot be Deserialized.
- CreateTransaction failing HOT 1
- TypeInitializationException when a class have a property that return an XElement value
- TypeInitializationException when deserialiaze a string to a class that have a static property
- Priority of Web Sockets HOT 1
- How to Store values in session
- Implement Forms Authentication Using ServiceStack HOT 1
- OrmPostgreSQL HOT 1
- Supporting for redis ZCOUNT command
- WCF helper implementation
- Null reference exception on call to GetAll HOT 2
- Broken link on Project Home HOT 2
- DeSerialising dictionary with type Dictionary<Tuple<string,string>,double>>() does not work
- Wrong Encoding
- ServiceStack.Redis reading large files from Redis server
- ServiceStack.Redis.RedisResponseException
- Db number is fogotten when using pooled clients.
- SOAP request and response wrappers
- Tutorial references ServiceStackHttpHandlerFactory which isn't included in ServiceStack.dll
- Future roadmap suggestion
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from servicestack.