我有一个不是wcf操作的方法,它执行身份验证检查
我如何缓存它的结果,大概60秒?并使用缓存的结果,如果在我的操作方法上退出,并且如果它不存在,执行该方法来获得结果?
我想根据用户名和密码来缓存这个方法。
public Autenticate (UserAccount useacc)
{
............
}
public class UserAccount
{
string username, passsword, domainname;
}发布于 2011-07-25 00:27:28
您可以查看此用于缓存的link。
你可以像下面这样使用这个类。
WCFCache.Current.Insert(username, useacc, DateTime.Now.AddMinutes(1));
//get an item from the cache
user = (UserAccount )WCFCache.Current[username];https://stackoverflow.com/questions/6808032
复制相似问题