BarNapkin.Infrastructure.WebUI.Filters.Errors.RedirectOnErrorAttribute.PlaceInItemDictionary C# (CSharp) Method

PlaceInItemDictionary() protected static method

protected static PlaceInItemDictionary ( string keyName, object item, System.Web.Mvc.ActionExecutedContext filterContext ) : void
keyName string
item object
filterContext System.Web.Mvc.ActionExecutedContext
return void
        protected static void PlaceInItemDictionary(string keyName, object item, ActionExecutedContext filterContext)
        {
            var collection = filterContext.HttpContext.Items;

            if (collection.Contains(keyName))
            {
                collection[keyName] = item;
            }
            else
            {
                collection.Add(keyName, item);
            }
        }