Merge in 'release/5.0-preview8' changes

This commit is contained in:
dotnet-bot 2020-07-29 20:30:41 +00:00
commit f22aa719ba
1 changed files with 2 additions and 1 deletions

View File

@ -143,7 +143,8 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata
static bool IsRecordType(Type type)
{
// Based on the state of the art as described in https://github.com/dotnet/roslyn/issues/45777
var cloneMethod = type.GetMethod("<>Clone", BindingFlags.Public | BindingFlags.Instance);
var cloneMethod = type.GetMethod("<Clone>$", BindingFlags.Public | BindingFlags.Instance) ??
type.GetMethod("<>Clone", BindingFlags.Public | BindingFlags.Instance);
return cloneMethod != null && cloneMethod.ReturnType == type;
}
}