Exemple #1
0
        public static EndpointHandlerParameterDeclaration GetParameterDeclarationForBindingAttribute(IParameterBindingSourceWithNameAttribute parameterBindingSourceWithNameAttribute, string parameterName, Type type, bool hasDefaultValue, object?defaultValue, EndpointDeclarationFactoryOptions options)
        {
            var parameterNameToBind = parameterBindingSourceWithNameAttribute.Name ?? parameterName;

            var(factory, infos) = GetParameterDeclaration(parameterNameToBind, type, hasDefaultValue, defaultValue, parameterBindingSourceWithNameAttribute.Source, type.IsArray, options);
            return(new SyncEndpointParameterDeclaration(factory, infos));
        }
Exemple #2
0
 public static EndpointHandlerParameterDeclaration GetParameterDeclarationForRoute(string parameterName, Type type, EndpointDeclarationFactoryOptions options)
 {
     var(factory, infos) = GetParameterDeclaration(parameterName, type, false, null, EndpointParameterSource.Route, type.IsArray, options);
     return(new SyncEndpointParameterDeclaration(factory, infos));
 }