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];
}
}