139 references to FormMethod
Microsoft.AspNetCore.Mvc.TagHelpers (1)
FormTagHelper.cs (1)
92
/// or if the <c>method</c> is <see cref="
FormMethod
.Get"/>; <c>true</c> otherwise.</value>
Microsoft.AspNetCore.Mvc.TagHelpers.Test (7)
FormTagHelperTest.cs (7)
370
[InlineData(null,
FormMethod
.Post, "<input />")]
371
[InlineData(true,
FormMethod
.Post, "<input />")]
372
[InlineData(false,
FormMethod
.Post, "")]
373
[InlineData(null,
FormMethod
.Get, "")]
374
[InlineData(true,
FormMethod
.Get, "<input />")]
375
[InlineData(false,
FormMethod
.Get, "")]
378
FormMethod
method,
Microsoft.AspNetCore.Mvc.ViewFeatures (35)
HtmlHelper.cs (11)
231
FormMethod
method,
248
FormMethod
method,
641
public static string GetFormMethodString(
FormMethod
method)
645
case
FormMethod
.Get:
647
case
FormMethod
.Post:
884
/// <paramref name="method"/> is not <see cref="
FormMethod
.Get"/>.
900
FormMethod
method,
917
var shouldGenerateAntiforgery = antiforgery ?? method !=
FormMethod
.Get;
942
/// <paramref name="method"/> is not <see cref="
FormMethod
.Get"/>.
957
FormMethod
method,
973
var shouldGenerateAntiforgery = antiforgery ?? method !=
FormMethod
.Get;
Rendering\HtmlHelperFormExtensions.cs (20)
31
method:
FormMethod
.Post,
61
method:
FormMethod
.Post,
78
public static MvcForm BeginForm(this IHtmlHelper htmlHelper,
FormMethod
method)
110
FormMethod
method,
134
/// <paramref name="method"/> is not <see cref="
FormMethod
.Get"/>.
149
FormMethod
method,
190
method:
FormMethod
.Post,
219
method:
FormMethod
.Post,
256
FormMethod
.Post,
279
FormMethod
method)
318
FormMethod
method)
354
FormMethod
method,
393
method:
FormMethod
.Post,
428
method:
FormMethod
.Post,
452
method:
FormMethod
.Post,
481
method:
FormMethod
.Post,
515
FormMethod
.Post,
536
FormMethod
method)
572
FormMethod
method)
605
FormMethod
method,
Rendering\IHtmlHelper.cs (4)
112
/// <paramref name="method"/> is not <see cref="
FormMethod
.Get"/>.
128
FormMethod
method,
148
/// <paramref name="method"/> is not <see cref="
FormMethod
.Get"/>.
163
FormMethod
method,
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (96)
DefaultEditorTemplatesTest.cs (2)
1431
FormMethod
method,
1441
FormMethod
method,
Rendering\HtmlHelperFormExtensionsTest.cs (50)
24
private static readonly IEnumerable<
FormMethod
> _methods = new List<
FormMethod
>
26
FormMethod
.Get,
27
FormMethod
.Post,
54
public static TheoryData<string, string,
FormMethod
> ActionNameControllerNameAndMethodDataSet
58
var dataSet = new TheoryData<string, string,
FormMethod
>();
63
foreach (
var
method in _methods)
74
public static TheoryData<string, string,
FormMethod
, object> ActionNameControllerNameMethodAndHtmlAttributesDataSet
78
var dataSet = new TheoryData<string, string,
FormMethod
, object>();
83
foreach (
var
method in _methods)
117
public static TheoryData<string, string, object,
FormMethod
> ActionNameControllerNameRouteValuesAndMethodDataSet
121
var dataSet = new TheoryData<string, string, object,
FormMethod
>();
128
foreach (
var
method in _methods)
140
public static TheoryData<
FormMethod
> MethodDataSet
144
var dataSet = new TheoryData<
FormMethod
>();
145
foreach (
var
method in _methods)
154
public static TheoryData<
FormMethod
, object> MethodAndHtmlAttributesDataSet
158
var dataSet = new TheoryData<
FormMethod
, object>();
159
foreach (
var
method in _methods)
185
public static TheoryData<string,
FormMethod
> RouteNameAndMethodDataSet
189
var dataSet = new TheoryData<string,
FormMethod
>();
192
foreach (
var
method in _methods)
202
public static TheoryData<string,
FormMethod
, object> RouteNameMethodAndHtmlAttributesDataSet
206
var dataSet = new TheoryData<string,
FormMethod
, object>();
209
foreach (
var
method in _methods)
239
public static TheoryData<string, object,
FormMethod
> RouteNameRouteValuesAndMethodDataSet
243
var dataSet = new TheoryData<string, object,
FormMethod
>();
248
foreach (
var
method in _methods)
382
public void BeginFormWithMethodParameter_CallsHtmlGeneratorWithExpectedValues(
FormMethod
method)
399
if (method !=
FormMethod
.Get)
425
FormMethod
method,
443
if (method !=
FormMethod
.Get)
469
FormMethod
method,
509
FormMethod
method,
666
FormMethod
method)
683
if (method !=
FormMethod
.Get)
712
FormMethod
method)
729
if (method !=
FormMethod
.Get)
757
FormMethod
method,
775
if (method !=
FormMethod
.Get)
803
FormMethod
method,
851
FormMethod
method,
1151
FormMethod
method)
1167
if (method !=
FormMethod
.Get)
1195
FormMethod
method)
1211
if (method !=
FormMethod
.Get)
1238
FormMethod
method,
1255
if (method !=
FormMethod
.Get)
1282
FormMethod
method,
1327
FormMethod
method,
Rendering\HtmlHelperFormTest.cs (40)
21
public static TheoryData<string, string, object,
FormMethod
, object> BeginFormDataSet
25
return new TheoryData<string, string, object,
FormMethod
, object>
28
null, null, null,
FormMethod
.Get, null
31
"Details", "Product", null,
FormMethod
.Get, null
34
"Details", "Product", null,
FormMethod
.Post, null
37
"Details", "Product", new { isprint = "false", showreviews = "false" },
FormMethod
.Get, null
40
"Details", "Product", new { isprint = "false", showreviews = "true" },
FormMethod
.Post, null
43
"Details", "Product", new { isprint = "true", showreviews = "false" },
FormMethod
.Get,
47
"Details", "Product", new { isprint = "true", showreviews = "true" },
FormMethod
.Post,
53
FormMethod
.Get,
59
FormMethod
.Post,
67
public static TheoryData<string, object,
FormMethod
, object> BeginRouteFormDataSet
71
return new TheoryData<string, object,
FormMethod
, object>
74
null, null,
FormMethod
.Get, null
77
null, null,
FormMethod
.Post, null
80
"default", null,
FormMethod
.Get, null
83
"default", null,
FormMethod
.Post, null
86
"default", new { isprint = "false", showreviews = "false" },
FormMethod
.Get, null
89
"default", new { isprint = "false", showreviews = "true" },
FormMethod
.Post, null
92
"default", new { isprint = "true", showreviews = "false" },
FormMethod
.Get,
96
"default", new { isprint = "true", showreviews = "true" },
FormMethod
.Post,
102
FormMethod
.Get,
108
FormMethod
.Post,
148
method:
FormMethod
.Post,
198
method:
FormMethod
.Post,
218
FormMethod
method,
267
FormMethod
method,
432
using (var form = htmlHelper.BeginForm(
FormMethod
.Post, antiforgery: null, htmlAttributes: null))
471
using (var form = htmlHelper.BeginForm(
FormMethod
.Post, antiforgery: false, htmlAttributes: null))
509
using (var form = htmlHelper.BeginForm(
FormMethod
.Get, antiforgery: null, htmlAttributes: null))
519
[InlineData(
FormMethod
.Get)]
520
[InlineData(
FormMethod
.Post)]
521
public void BeginForm_EndForm_DoesNotSuppressAntiforgeryTokenWhenAntiforgeryIsTrue(
FormMethod
method)
588
using (var form = htmlHelper.BeginForm(
FormMethod
.Post, antiforgery: false, htmlAttributes: null))
668
method:
FormMethod
.Post,
711
method:
FormMethod
.Post,
753
method:
FormMethod
.Get,
765
[InlineData(
FormMethod
.Get)]
766
[InlineData(
FormMethod
.Post)]
767
public void BeginRouteForm_EndForm_DoesNotSuppressAntiforgeryTokenWhenAntiforgeryIsTrue(
FormMethod
method)
Rendering\HtmlHelperTest.cs (4)
380
[InlineData(
FormMethod
.Get, "get")]
381
[InlineData(
FormMethod
.Post, "post")]
382
[InlineData((
FormMethod
)42, "post")]
383
public void GetFormMethodString_ReturnsExpectedValues(
FormMethod
method, string expected)