We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07bfa5e commit e1daca0Copy full SHA for e1daca0
src/Nest/CommonAbstractions/Infer/TypeName/TypeNameResolver.cs
@@ -39,9 +39,7 @@ private string ResolveType(Type type)
39
else
40
{
41
var dataContract = type.GetAttributes<DataContractAttribute>().FirstOrDefault();
42
- typeName = dataContract != null
43
- ? dataContract.Name
44
- : _connectionSettings.DefaultTypeNameInferrer(type);
+ typeName = dataContract?.Name ?? _connectionSettings.DefaultTypeNameInferrer(type);
45
}
46
if (typeName.IsNullOrEmpty()) throw new ArgumentNullException($"{type.FullName} resolved to an empty string or null");
47
0 commit comments