DAL nesnelerinde Manual Caching

 

public class DALProduct

{

static DALProduct()

{

//singleton cache nesnesi

if (_ProductCache==null)

{

_ProductCache = new Dictionary<int, Product>();

}

}

private static Dictionary<int, Product> _ProductCache;

public static Product GetbyProductID(int ID)

{

if (_ProductCache.ContainsKey(ID))

{

return _ProductCache[ID];

}

else

{

/*Baglan Dbye cek product ekle dictonarye

*

* */

_ProductCache.Add(ID, _product);

}

return _ProductCache[ID];

}

}

20 Ağustos 2007 Pazartesi 14:26 gönderen MuratHAKSAL

Yorumlar