473,327 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

C# List Object References

We're using the HttpRuntime Cache for our objects and we're trying to do the following.

We pull lists of objects from the database and put them in cache. We put a reference to the list in cache, but we also put references to the individual items so we can access them without having to search the lists. The objects and lists each have unique identifiers. The issue is when we want to update the object. Lets say we pull an individual object from the database. We need to update the individual reference in cache plus the list reference. We would like to do this without having to find every reference in all of the lists.

For example, we have 4 objects in the database and we pull two lists.
The cache would have the following references.
List1 -> 1,2,3
List2 - > 2,3,4
1
2
3
4

Initially I can access object 3 using the list or directly, and I get a reference to the same object.
Now what can happen is someone will load object 3 from the database individually. I need to update both references without having to look in every list.
This would be fairly easy using pointers directly, but I don't want to get into unsafe code.
Hope this makes sense.
Feb 12 '08 #1
0 5663

Sign in to post your reply or Sign up for a free account.

Similar topics

23
by: Fuzzyman | last post by:
Pythons internal 'pointers' system is certainly causing me a few headaches..... When I want to copy the contents of a variable I find it impossible to know whether I've copied the contents *or*...
1
by: John Hunter | last post by:
I am writing a python extension module and have a reference counting question My function looks like static PyObject * pokereval_seven_cards(PyObject *self, PyObject *args) { int i;
2
by: Thomas Miller | last post by:
Hello, I have built a c# class library (I will call it "Assembly1"), and built an installer that installs it. It is working well. I created a new asp.net application, right-clicked on references...
7
by: Jax | last post by:
I understand that it's supposed to contain text, usually. But as it takes an object can you be really cheeky and put a very complex object in there instead? Would any problems come from doing...
1
by: Luke Matuszewski | last post by:
Hej everybody. I am writing a lot of code in JavaScript, and my code begins too look to complicated... My work would be more effective is i could somehow emulate Sets, Lists and Maps especially...
9
by: sks | last post by:
dear all, i have a problem . consider the following code class ABC { int & r; public: ABC( int &a) : r(a) {} }; int main() {
2
by: B.N.Prabhu | last post by:
In my web application(C#) . I am adding one excel sheet and then save and closing that excel file. In the finally bloack i gave Marshal.ReleaseComObject(clsExcel); But when i go and see in the...
0
by: crazyone | last post by:
I've got a gaming framework i'm building and i want to save myself the trouble of reading and writting the complete game data to a custom file and load/save it to an XML file but i'm getting...
2
by: Jeff | last post by:
..NET 2.0 I'm trying to use List.Contains to determine if an object already exist in the list. This Contains method always return false in my code In my code a method gets a list of names, the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.