Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Web;
- namespace Freelancers.Infrastructure.Storage
- {
- public class CacheStorage : ICacheStorage
- {
- public void Remove(string key)
- {
- Ensure.Argument.NotNullOrEmpty(key, "key");
- HttpContext.Current.Cache.Remove(key);
- }
- public void Store(string key, object data)
- {
- Ensure.Argument.NotNullOrEmpty(key, "key");
- Ensure.Argument.NotNull(data, "data");
- HttpContext.Current.Cache.Insert(key, data);
- }
- public T Retrieve<T>(string key) where T : class
- {
- Ensure.Argument.NotNullOrEmpty(key, "key");
- return (T)HttpContext.Current.Cache.Get(key);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment