Giter VIP home page Giter VIP logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 25, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 25, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 25, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 25, 2024

Original comment by [email protected] on 28 Aug 2010 at 5:25

  • Changed state: Fixed

from servicestack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.