Skip to content

Commit 4ad209c

Browse files
committed
Name refactoring.
1 parent d29b146 commit 4ad209c

File tree

2 files changed

+42
-42
lines changed

2 files changed

+42
-42
lines changed

DevTrends.MvcDonutCaching/HtmlHelperExtensions.cs

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
using System.Web.Mvc;
1+
using DevTrends.MvcDonutCaching.Annotations;
2+
using System.Web.Mvc;
23
using System.Web.Mvc.Html;
34
using System.Web.Routing;
4-
using DevTrends.MvcDonutCaching.Annotations;
55

66
namespace DevTrends.MvcDonutCaching
77
{
@@ -24,174 +24,174 @@ public static IActionSettingsSerialiser Serialiser
2424
/// <summary>
2525
/// Invokes the specified child action method and returns the result as an HTML string.
2626
/// </summary>
27-
/// <param name="htmlHelper">The HTML helper instance that this method extends.</param>
27+
/// <param name="h">The HTML helper instance that this method extends.</param>
2828
/// <param name="actionName">The name of the action method to invoke.</param>
2929
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
3030
/// <returns>The child action result as an HTML string.</returns>
31-
public static MvcHtmlString Action(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, bool excludeFromParentCache)
31+
public static MvcHtmlString Action(this HtmlHelper h, [AspMvcAction] string actionName, bool excludeFromParentCache)
3232
{
33-
return htmlHelper.Action(actionName, null, null, excludeFromParentCache);
33+
return h.Action(actionName, null, null, excludeFromParentCache);
3434
}
3535

3636
/// <summary>
3737
/// Invokes the specified child action method using the specified parameters and returns the result as an HTML string.
3838
/// </summary>
39-
/// <param name="htmlHelper">The HTML helper instance that this method extends.</param>
39+
/// <param name="h">The HTML helper instance that this method extends.</param>
4040
/// <param name="actionName">The name of the action method to invoke.</param>
4141
/// <param name="routeValues">An object that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.</param>
4242
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
4343
/// <returns>The child action result as an HTML string.</returns>
44-
public static MvcHtmlString Action(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, object routeValues, bool excludeFromParentCache)
44+
public static MvcHtmlString Action(this HtmlHelper h, [AspMvcAction] string actionName, object routeValues, bool excludeFromParentCache)
4545
{
46-
return htmlHelper.Action(actionName, null, new RouteValueDictionary(routeValues), excludeFromParentCache);
46+
return h.Action(actionName, null, new RouteValueDictionary(routeValues), excludeFromParentCache);
4747
}
4848

4949
/// <summary>
5050
/// Invokes the specified child action method using the specified parameters and returns the result as an HTML string.
5151
/// </summary>
52-
/// <param name="htmlHelper">The HTML helper instance that this method extends.</param>
52+
/// <param name="h">The HTML helper instance that this method extends.</param>
5353
/// <param name="actionName">The name of the action method to invoke.</param>
5454
/// <param name="routeValues">A dictionary that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.</param>
5555
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
5656
/// <returns>The child action result as an HTML string.</returns>
57-
public static MvcHtmlString Action(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, RouteValueDictionary routeValues, bool excludeFromParentCache)
57+
public static MvcHtmlString Action(this HtmlHelper h, [AspMvcAction] string actionName, RouteValueDictionary routeValues, bool excludeFromParentCache)
5858
{
59-
return htmlHelper.Action(actionName, null, routeValues, excludeFromParentCache);
59+
return h.Action(actionName, null, routeValues, excludeFromParentCache);
6060
}
6161

6262
/// <summary>
6363
/// Invokes the specified child action method using the specified parameters and controller name and returns the result as an HTML string.
6464
/// </summary>
65-
/// <param name="htmlHelper">The HTML helper instance that this method extends.</param>
65+
/// <param name="h">The HTML helper instance that this method extends.</param>
6666
/// <param name="actionName">The name of the action method to invoke.</param>
6767
/// <param name="controllerName">The name of the controller that contains the action method.</param>
6868
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
6969
/// <returns>The child action result as an HTML string.</returns>
70-
public static MvcHtmlString Action(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, [AspMvcController] string controllerName, bool excludeFromParentCache)
70+
public static MvcHtmlString Action(this HtmlHelper h, [AspMvcAction] string actionName, [AspMvcController] string controllerName, bool excludeFromParentCache)
7171
{
72-
return htmlHelper.Action(actionName, controllerName, null, excludeFromParentCache);
72+
return h.Action(actionName, controllerName, null, excludeFromParentCache);
7373
}
7474

7575
/// <summary>
7676
/// Invokes the specified child action method using the specified parameters and controller name and returns the result as an HTML string.
7777
/// </summary>
78-
/// <param name="htmlHelper">The HTML helper instance that this method extends.</param>
78+
/// <param name="h">The HTML helper instance that this method extends.</param>
7979
/// <param name="actionName">The name of the action method to invoke.</param>
8080
/// <param name="controllerName">The name of the controller that contains the action method.</param>
8181
/// <param name="routeValues">An object that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.</param>
8282
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
8383
/// <returns>The child action result as an HTML string.</returns>
84-
public static MvcHtmlString Action(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, [AspMvcController] string controllerName, object routeValues, bool excludeFromParentCache)
84+
public static MvcHtmlString Action(this HtmlHelper h, [AspMvcAction] string actionName, [AspMvcController] string controllerName, object routeValues, bool excludeFromParentCache)
8585
{
86-
return htmlHelper.Action(actionName, controllerName, new RouteValueDictionary(routeValues), excludeFromParentCache);
86+
return h.Action(actionName, controllerName, new RouteValueDictionary(routeValues), excludeFromParentCache);
8787
}
8888

8989
/// <summary>
9090
/// Invokes the specified child action method using the specified parameters and controller name and renders the result inline in the parent view.
9191
/// </summary>
92-
/// <param name="htmlHelper">The HTML helper instance that this method extends.</param>
92+
/// <param name="h">The HTML helper instance that this method extends.</param>
9393
/// <param name="actionName">The name of the child action method to invoke.</param>
9494
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
9595

96-
public static void RenderAction(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, bool excludeFromParentCache)
96+
public static void RenderAction(this HtmlHelper h, [AspMvcAction] string actionName, bool excludeFromParentCache)
9797
{
98-
RenderAction(htmlHelper, actionName, null, null, excludeFromParentCache);
98+
RenderAction(h, actionName, null, null, excludeFromParentCache);
9999
}
100100

101101
/// <summary>
102102
/// Invokes the specified child action method using the specified parameters and controller name and renders the result inline in the parent view.
103103
/// </summary>
104-
/// <param name="htmlHelper">The HTML helper instance that this method extends.</param>
104+
/// <param name="h">The HTML helper instance that this method extends.</param>
105105
/// <param name="actionName">The name of the child action method to invoke.</param>
106106
/// <param name="routeValues">A dictionary that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.</param>
107107
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
108108

109-
public static void RenderAction(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, object routeValues, bool excludeFromParentCache)
109+
public static void RenderAction(this HtmlHelper h, [AspMvcAction] string actionName, object routeValues, bool excludeFromParentCache)
110110
{
111-
RenderAction(htmlHelper, actionName, null, new RouteValueDictionary(routeValues), excludeFromParentCache);
111+
RenderAction(h, actionName, null, new RouteValueDictionary(routeValues), excludeFromParentCache);
112112
}
113113

114114
/// <summary>
115115
/// Invokes the specified child action method using the specified parameters and controller name and renders the result inline in the parent view.
116116
/// </summary>
117-
/// <param name="htmlHelper">The HTML helper instance that this method extends.</param>
117+
/// <param name="h">The HTML helper instance that this method extends.</param>
118118
/// <param name="actionName">The name of the child action method to invoke.</param>
119119
/// <param name="routeValues">A dictionary that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.</param>
120120
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
121-
public static void RenderAction(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, RouteValueDictionary routeValues, bool excludeFromParentCache)
121+
public static void RenderAction(this HtmlHelper h, [AspMvcAction] string actionName, RouteValueDictionary routeValues, bool excludeFromParentCache)
122122
{
123-
RenderAction(htmlHelper, actionName, null, routeValues, excludeFromParentCache);
123+
RenderAction(h, actionName, null, routeValues, excludeFromParentCache);
124124
}
125125

126126
/// <summary>
127127
/// Invokes the specified child action method using the specified parameters and controller name and renders the result inline in the parent view.
128128
/// </summary>
129-
/// <param name="htmlHelper">The HTML helper instance that this method extends.</param>
129+
/// <param name="h">The HTML helper instance that this method extends.</param>
130130
/// <param name="actionName">The name of the child action method to invoke.</param>
131131
/// <param name="controllerName">The name of the controller that contains the action method.</param>
132132
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
133-
public static void RenderAction(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, [AspMvcController] string controllerName, bool excludeFromParentCache)
133+
public static void RenderAction(this HtmlHelper h, [AspMvcAction] string actionName, [AspMvcController] string controllerName, bool excludeFromParentCache)
134134
{
135-
RenderAction(htmlHelper, actionName, controllerName, null, excludeFromParentCache);
135+
RenderAction(h, actionName, controllerName, null, excludeFromParentCache);
136136
}
137137

138138
/// <summary>
139139
/// Invokes the specified child action method using the specified parameters and controller name and renders the result inline in the parent view.
140140
/// </summary>
141-
/// <param name="htmlHelper">The HTML helper instance that this method extends.</param>
141+
/// <param name="h">The HTML helper instance that this method extends.</param>
142142
/// <param name="actionName">The name of the child action method to invoke.</param>
143143
/// <param name="controllerName">The name of the controller that contains the action method.</param>
144144
/// <param name="routeValues">A dictionary that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.</param>
145145
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
146-
public static void RenderAction(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, [AspMvcController] string controllerName, object routeValues, bool excludeFromParentCache)
146+
public static void RenderAction(this HtmlHelper h, [AspMvcAction] string actionName, [AspMvcController] string controllerName, object routeValues, bool excludeFromParentCache)
147147
{
148-
RenderAction(htmlHelper, actionName, controllerName, new RouteValueDictionary(routeValues), excludeFromParentCache);
148+
RenderAction(h, actionName, controllerName, new RouteValueDictionary(routeValues), excludeFromParentCache);
149149
}
150150

151151
/// <summary>
152152
/// Invokes the specified child action method using the specified parameters and controller name and renders the result inline in the parent view.
153153
/// </summary>
154-
/// <param name="htmlHelper">The HTML helper instance that this method extends.</param>
154+
/// <param name="h">The HTML helper instance that this method extends.</param>
155155
/// <param name="actionName">The name of the child action method to invoke.</param>
156156
/// <param name="controllerName">The name of the controller that contains the action method.</param>
157157
/// <param name="routeValues">A dictionary that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.</param>
158158
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
159-
public static void RenderAction(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, [AspMvcController] string controllerName, RouteValueDictionary routeValues, bool excludeFromParentCache)
159+
public static void RenderAction(this HtmlHelper h, [AspMvcAction] string actionName, [AspMvcController] string controllerName, RouteValueDictionary routeValues, bool excludeFromParentCache)
160160
{
161161
if (excludeFromParentCache)
162162
{
163163
var serialisedActionSettings = GetSerialisedActionSettings(actionName, controllerName, routeValues);
164164

165-
htmlHelper.ViewContext.Writer.Write("<!--Donut#{0}#-->", serialisedActionSettings);
165+
h.ViewContext.Writer.Write("<!--Donut#{0}#-->", serialisedActionSettings);
166166
}
167167

168-
htmlHelper.RenderAction(actionName, controllerName, routeValues);
168+
h.RenderAction(actionName, controllerName, routeValues);
169169

170170
if (excludeFromParentCache)
171171
{
172-
htmlHelper.ViewContext.Writer.Write("<!--EndDonut-->");
172+
h.ViewContext.Writer.Write("<!--EndDonut-->");
173173
}
174174
}
175175

176176
/// <summary>
177177
/// Invokes the specified child action method using the specified parameters and controller name and returns the result as an HTML string.
178178
/// </summary>
179-
/// <param name="htmlHelper">The HTML helper instance that this method extends.</param>
179+
/// <param name="h">The HTML helper instance that this method extends.</param>
180180
/// <param name="actionName">The name of the action method to invoke.</param>
181181
/// <param name="controllerName">The name of the controller that contains the action method.</param>
182182
/// <param name="routeValues">A dictionary that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.</param>
183183
/// <param name="excludeFromParentCache">A flag that determines whether the action should be excluded from any parent cache.</param>
184184
/// <returns>The child action result as an HTML string.</returns>
185-
public static MvcHtmlString Action(this HtmlHelper htmlHelper, [AspMvcAction] string actionName, [AspMvcController] string controllerName, RouteValueDictionary routeValues, bool excludeFromParentCache)
185+
public static MvcHtmlString Action(this HtmlHelper h, [AspMvcAction] string actionName, [AspMvcController] string controllerName, RouteValueDictionary routeValues, bool excludeFromParentCache)
186186
{
187187
if (excludeFromParentCache)
188188
{
189189
var serialisedActionSettings = GetSerialisedActionSettings(actionName, controllerName, routeValues);
190190

191-
return new MvcHtmlString(string.Format("<!--Donut#{0}#-->{1}<!--EndDonut-->", serialisedActionSettings, htmlHelper.Action(actionName, controllerName, routeValues)));
191+
return new MvcHtmlString(string.Format("<!--Donut#{0}#-->{1}<!--EndDonut-->", serialisedActionSettings, h.Action(actionName, controllerName, routeValues)));
192192
}
193193

194-
return htmlHelper.Action(actionName, controllerName, routeValues);
194+
return h.Action(actionName, controllerName, routeValues);
195195
}
196196

197197
private static string GetSerialisedActionSettings(string actionName, string controllerName, RouteValueDictionary routeValues)

DevTrends.MvcDonutCaching/OutputCacheManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public void RemoveItems([AspMvcController] string controllerName, [AspMvcAction]
119119
public void RemoveItems([AspMvcController] string controllerName, [AspMvcAction] string actionName, RouteValueDictionary routeValues)
120120
{
121121
var enumerableCache = _outputCacheProvider as IEnumerable<KeyValuePair<string, object>>;
122-
122+
123123
if (enumerableCache == null)
124124
{
125125
throw new NotSupportedException("Ensure that your custom OutputCacheProvider implements IEnumerable<KeyValuePair<string, object>>.");

0 commit comments

Comments
 (0)