private string MapParameterName(ActionParameter parameter) { var bindingMode = _configuration.HeadersBindingMode; if (bindingMode == BindingMode.Convention && HasHeaderPostfix(parameter.Name)) { return(parameter.Name.Truncate(HeaderPostfix.Length)); } if (bindingMode == BindingMode.Explicit || bindingMode == BindingMode.Implicit) { return(parameter.GetAttribute <FromHeadersAttribute>()?.Name ?? parameter.Name); } return(parameter.Name); }
protected virtual string MapName(ActionParameter parameter) { return(parameter.GetAttribute <NameAttribute>()?.Name ?? parameter.Name); }
private string MapParameterName(ActionParameter parameter) { return(parameter.GetAttribute <FromRequestPropertiesAttribute>()?.Name ?? parameter.Name); }
public T GetAttribute <T>() where T : Attribute => _parameter.GetAttribute <T>();