本文整理匯總了C#中System.Web.Mvc.ActionExecutingContext.DBIsInstalled方法的典型用法代碼示例。如果您正苦於以下問題:C# ActionExecutingContext.DBIsInstalled方法的具體用法?C# ActionExecutingContext.DBIsInstalled怎麽用?C# ActionExecutingContext.DBIsInstalled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Web.Mvc.ActionExecutingContext
的用法示例。
在下文中一共展示了ActionExecutingContext.DBIsInstalled方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: OnActionExecuting
/// <summary>
/// Save current visited page url to store for using in future
/// </summary>
/// <param name="filterContext"></param>
public virtual void OnActionExecuting(ActionExecutingContext filterContext)
{
if (!filterContext.DBIsInstalled())
return;
if (!filterContext.HasRequest())
return;
var httpHelper = DependencyResolver.Current.GetService<IHttpHelper>();
var requestUrl = httpHelper.GetCurrentRequestUrl(true);
if (!string.IsNullOrEmpty(requestUrl)) // if has request url, store it
{
var context = DependencyResolver.Current.GetService<WebWorkContextBase>();
var userService = DependencyResolver.Current.GetService<IUserDataService>();
var storedUrl = context.CurrentUser.GetCharacteristic<string>(UserCharacteristicResource.LastVisitedPage);
if (requestUrl != storedUrl)
{
//userService.SaveUserCharacteristic(context.CurrentUser, UserCharacteristicResource.LastVisitedPage, requestUrl); // update stored url
}
}
}