Prefer string.Equals static method over the Equals instance method
This commit is contained in:
parent
cb21c34770
commit
44af396da9
|
|
@ -2,10 +2,9 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Reflection;
|
|
||||||
using Microsoft.AspNet.Mvc.ModelBinding.Internal;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Mvc.ModelBinding
|
namespace Microsoft.AspNet.Mvc.ModelBinding
|
||||||
|
|
@ -181,7 +180,7 @@ namespace Microsoft.AspNet.Mvc.ModelBinding
|
||||||
for (var i = 0; i < _supportedEncodings.Count; i++)
|
for (var i = 0; i < _supportedEncodings.Count; i++)
|
||||||
{
|
{
|
||||||
var supportedEncoding = _supportedEncodings[i];
|
var supportedEncoding = _supportedEncodings[i];
|
||||||
if (charset.Equals(supportedEncoding.WebName, StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(charset, supportedEncoding.WebName, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
return supportedEncoding;
|
return supportedEncoding;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ namespace Microsoft.AspNet.Mvc.ModelBinding
|
||||||
|
|
||||||
public ValueProviderResult GetValue(string key)
|
public ValueProviderResult GetValue(string key)
|
||||||
{
|
{
|
||||||
return String.Equals(key, Name, StringComparison.OrdinalIgnoreCase)
|
return string.Equals(key, Name, StringComparison.OrdinalIgnoreCase)
|
||||||
? new ValueProviderResult(RawValue, Convert.ToString(RawValue, Culture), Culture)
|
? new ValueProviderResult(RawValue, Convert.ToString(RawValue, Culture), Culture)
|
||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ namespace Microsoft.AspNet.Mvc.ModelBinding
|
||||||
{
|
{
|
||||||
var contentType = request.GetContentType();
|
var contentType = request.GetContentType();
|
||||||
return contentType != null &&
|
return contentType != null &&
|
||||||
contentType.ContentType.Equals(FormEncodedContentType, StringComparison.OrdinalIgnoreCase);
|
string.Equals(contentType.ContentType, FormEncodedContentType, StringComparison.OrdinalIgnoreCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static CultureInfo GetCultureInfo(HttpRequest request)
|
private static CultureInfo GetCultureInfo(HttpRequest request)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue