using StackExchange.Redis;
using System.Collections.Generic;
namespace CachingFramework.Redis.Demo
public static string Config = "chubb.redistogo.com:9791, password=1cf67bd6023a1dc7c17332a6c2cc3fca, resolveDns=true, connectTimeout=2000, allowAdmin=true, connectRetry=10, abortConnect=false";
public static void Main(string[] args)
var context = new Context(Config);
string redisKey = "user:1";
User value = new User() { Id = 1 };
context.Cache.SetObject(redisKey, value);
context.Cache.SetObject(redisKey, value, TimeSpan.FromHours(1));
ConnectionMultiplexer redis = ConnectionMultiplexer.Connect(Config);
var db = redis.GetDatabase();
var foo = db.StringGet("foo");
public int Id { get; set; }
public List<Department> Deparments { get; set; }
public class Department : IDto
public int Id { get; set; }
public Location Location { get; set; }
public int Size { get; set; }
public decimal Distance { get; set; }
public class Location : IDto
public int Id { get; set; }
public string Name { get; set; }
public byte[] Data { get; set; }
public class DistributorInfo
public DistributorInfo Parent { get; set; }
public string DistributorId { get; set; }
public string Subtype { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string CompleteName { get { return LastName + ";" + FirstName; } }
public class DistributorCompReview
public string DistributorId { get; set; }
public bool MatchingVolumePenalty { get; set; }
public bool RetiredSupervisor { get; set; }