Taking Generated Query from String and Matching it to an Entity

Posts   
 
    
BaileyK83
User
Posts: 29
Joined: 30-Dec-2006
# Posted on: 22-Aug-2007 02:13:59   

I DOUBT this but its worth a shot

I take the RelationPredicateBucketText

[MAINDB].[dbo].[obj].[MainId] > @MainID2

Replace the ParameterNames with the Values

[MAINDB].[dbo].[obj].[MainId] > 100

Use this as the Cache Key (Along with the Entity Name)

I get the Key Back, is there a way to match this string with an Entity?

Obj:SomeEntity MainID: 10

????

BaileyK83
User
Posts: 29
Joined: 30-Dec-2006
# Posted on: 22-Aug-2007 03:04:17   

Actually Another Question

ToQueryText()... how do I use this without going to the database first... I tried to set the databasespecificcreator but of course thta just threw a null object exception (of course)

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 22-Aug-2007 11:33:06   

I DOUBT this but its worth a shot

I take the RelationPredicateBucketText

[MAINDB].[dbo].[obj].[MainId] > @MainID2

Replace the ParameterNames with the Values

[MAINDB].[dbo].[obj].[MainId] > 100

Use this as the Cache Key (Along with the Entity Name)

I get the Key Back, is there a way to match this string with an Entity?

I don't understand the context of the question. Would you please explain why do you need to do this, maybe there is another easier way of doing it?

BaileyK83
User
Posts: 29
Joined: 30-Dec-2006
# Posted on: 22-Aug-2007 19:57:31   

I'm implementing caching on EntityCollections

When an entity is saved I want to check the cache and remove any entity collections that contain the entity that was saved.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 23-Aug-2007 10:50:40   

[MAINDB].[dbo].[obj].[MainId] > 100

Use this as the Cache Key (Along with the Entity Name)

And why do you use the above as the cache key, instead of the Entity's PK value?