32 references to ConvertTo
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinding\ModelBindingHelper.cs (1)
598
var converted =
ConvertTo
(value, typeof(T), culture);
Microsoft.AspNetCore.Mvc.Core.Test (30)
ModelBinding\Binders\CollectionModelBinderTest.cs (1)
517
var model = ModelBindingHelper.
ConvertTo
(valueToConvert, context.ModelType, value.Culture);
ModelBinding\ModelBindingHelperTest.cs (29)
845
var convertedValue = ModelBindingHelper.
ConvertTo
(value: null, type: typeof(string), culture: null);
852
var convertedValue = ModelBindingHelper.
ConvertTo
(value: null, type: typeof(int), culture: null);
863
var converted = ModelBindingHelper.
ConvertTo
(value, typeof(string), culture: null);
928
var outValue = ModelBindingHelper.
ConvertTo
(new string[] { null }, typeof(int), culture: null);
940
var outValue = ModelBindingHelper.
ConvertTo
(new int[0], typeof(int), culture: null);
953
var outValue = ModelBindingHelper.
ConvertTo
(value, typeof(int), culture: null);
965
var outValue = ModelBindingHelper.
ConvertTo
(value: null, type: typeof(int[]), culture: null);
977
var outValue = ModelBindingHelper.
ConvertTo
(new object[] { 1 }, typeof(IntEnum), culture: null);
1010
var outValue = ModelBindingHelper.
ConvertTo
(new object[] { input }, enumType, culture: null);
1022
var outValue = ModelBindingHelper.
ConvertTo
(new object[] { "1" }, typeof(IntEnum), culture: null);
1034
var outValue = ModelBindingHelper.
ConvertTo
(new object[] { "Value1" }, typeof(IntEnum), culture: null);
1046
var outValue = ModelBindingHelper.
ConvertTo
("12", typeof(int?), culture: null);
1058
var outValue = ModelBindingHelper.
ConvertTo
("12.5", typeof(double?), culture: null);
1070
var outValue = ModelBindingHelper.
ConvertTo
(12M, typeof(int?), culture: null);
1082
var outValue = ModelBindingHelper.
ConvertTo
(12.5M, typeof(double?), culture: null);
1094
var outValue = ModelBindingHelper.
ConvertTo
(12M, typeof(int?), culture: null);
1106
var outValue = ModelBindingHelper.
ConvertTo
(12M, typeof(long?), culture: null);
1118
var outValue = ModelBindingHelper.
ConvertTo
(new object[] { "some string" }, typeof(string), culture: null);
1133
var outValue = ModelBindingHelper.
ConvertTo
(value, typeof(IntEnum[]), culture: null);
1151
var outValue = ModelBindingHelper.
ConvertTo
(value, typeof(FlagsEnum[]), culture: null);
1167
var outValue = ModelBindingHelper.
ConvertTo
(original, typeof(string[]), culture: null);
1183
() => ModelBindingHelper.
ConvertTo
("this-is-not-a-valid-value", destinationType, culture: null));
1192
var cultureResult = ModelBindingHelper.
ConvertTo
("12,5", typeof(decimal), new CultureInfo("fr-FR"));
1197
() => ModelBindingHelper.
ConvertTo
("12,5", typeof(decimal), new CultureInfo("en-GB")));
1207
Assert.Equal(expectedValue, ModelBindingHelper.
ConvertTo
(initialValue, typeof(T), culture: null));
1250
() => ModelBindingHelper.
ConvertTo
(new MyClassWithoutConverter(), destinationType, culture: null));
1266
() => ModelBindingHelper.
ConvertTo
(value, destinationType, culture: null));
1280
var result = ModelBindingHelper.
ConvertTo
(value, destinationType, culture: null);
1300
var result = ModelBindingHelper.
ConvertTo
(value, destinationType, culture: null);
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
DefaultHtmlGenerator.cs (1)
1068
return ModelBindingHelper.
ConvertTo
(entry.RawValue, destinationType, culture: null);