Files
ProductiveAspNetMvc/Ch04/04_03_End/Website/Extensions/TempDataExtensions.cs
Jess Chadwick 20458e435e Exercise Files
2018-06-07 00:03:24 -04:00

22 lines
593 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace HPlusSports
{
public static class TempDataExtensions
{
const string SuccessMessageKey = "SuccessMessage";
public static string SuccessMessage(this System.Web.Mvc.TempDataDictionary tempData)
{
return tempData[SuccessMessageKey] as string;
}
public static void SuccessMessage(this System.Web.Mvc.TempDataDictionary tempData, string successMessage)
{
tempData[SuccessMessageKey] = successMessage;
}
}
}