|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//Namespace needed for caching
using Microsoft.Data.Caching;
namespace Velocity_Sample
{
class Program
{
static void Main(string[] args)
{
//Cache factory object -> Different algorithms for working with the cache
DataCacheFactory dcfFactory =
new DataCacheFactory();
//Cache object for putting and retrieving data
DataCache dcCache =
dcfFactory.GetDefaultCache();
//Putting data into the cache
dcCache.Put("CHI1", "JcGonzalez");
//Getting data from the cache
Console.WriteLine("Valor en caché {0}",dcCache.Get("CHI1"));
Console.WriteLine();
try
{
dcCache = dcfFactory.GetCache("Inventario");
}
catch (Exception ex)
{
(ex.Message);
}
Console.ReadLine();
}
}
}
|