ASP.NET MVC TempData Extension Methods - DONN FELKER: "public static class TempDataExtensions
{
public static void Put(this TempDataDictionary tempData, T value) where T : class
{
tempData[typeof(T).FullName] = value;
}
public static void Put(this TempDataDictionary tempData, string key, T value) where T : class
{
tempData[typeof(T).FullName + key] = value;
}
public static T Get(this TempDataDictionary tempData) where T : class
{
object o;
tempData.TryGetValue(typeof(T).FullName, out o);
return o == null ? null : (T)o;
}
public static T Get(this TempDataDictionary tempData, string key) where T : class
{
object o;
tempData.TryGetValue(typeof(T).FullName + key, out o);
return o == null ? null : (T)o;
}
}"
'via Blog this'
Popular Posts
-
Kendo UI applying SUM in footer template kendo ui - KendoUI: Grid Summary values in Footer - Stack Overflow : ", footerTemplate:...
-
MVC grid example ASP.NET MVC Flexigrid sample - CodeProject : 'via Blog this'
-
A possible way of handling distributed transaction for multiple contexts without alleviation to MSDTC??? c# - Entity Framework - Using Trans...
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment