/// <summary> /// Get <see cref="Atomia.Store.Core.ResellerIdentifier"/> from session, or default with empty hash and current base URI. /// </summary> public ResellerIdentifier GetResellerIdentifier() { var identifier = HttpContext.Current.Session["ResellerIdentifier"] as ResellerIdentifier; if (identifier == null) { identifier = new ResellerIdentifier { AccountHash = "", BaseUrl = BaseUriHelper.GetBaseUriString() }; } return identifier; }
public override void OnActionExecuting(ActionExecutingContext filterContext) { var request = filterContext.HttpContext.Request; if (filterContext.Controller.ControllerContext.IsChildAction || request.IsAjaxRequest()) { return; } if (request.QueryString["reseller"] != null) { var identifier = new ResellerIdentifier() { AccountHash = request.QueryString["reseller"], BaseUrl = BaseUriHelper.GetBaseUriString() }; var resellerIdentifierProvider = DependencyResolver.Current.GetService<IResellerIdentifierProvider>(); resellerIdentifierProvider.SetResellerIdentifier(identifier); } }
/// <summary> /// Save <see cref="ResellerIdentifier"/> in session /// </summary> public void SetResellerIdentifier(ResellerIdentifier identifier) { HttpContext.Current.Session["ResellerIdentifier"] = identifier; }
public void SetResellerIdentifier(ResellerIdentifier identifier) { }