Alexandria.Client.Infrastructure.PersistentCache.Put C# (CSharp) Method

Put() public method

public Put ( string key, System.DateTime timestamp, object instance ) : void
key string
timestamp System.DateTime
instance object
return void
        public void Put(string key, DateTime timestamp, object instance)
        {
            using (var file = File.Create(Path.Combine(basePath, EscapeKey(key))))
            {
                new BinaryFormatter().Serialize(file, new CachedData
                {
                    Timestamp = timestamp,
                    Value = instance
                });
                file.Flush();
            }
        }