Cache middle tier Object based on its properties

A

AjitGoel

it is possible to cache an object based on its properties?? To give
more details, I have an entity object whose different properties are
set from different and expensive web services. i have some sample code
down below. I want instances of object class1 to be cached for
different values of a1 and a2.
Do we have built in functionality in ASP.NET that can do this(probably
by setting some class level attributes) or I will have to write
customcode for this?? Eg:

Class class1
{
private int _a1;
private int _a2;

public a(int a1, int a2)
{
this._a1= a1;
this._a2= a2;
}

public int a3
{
get
{
<expensive operation 1 to fill>
}
}

public int a4
{
get
{
<expensive operation 2 to fill>
}
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top