# FunctionTypeBuilder

Class in [Yarn.Compiler](https://docs.yarnspinner.dev/api/csharp/yarn.compiler)

Inherits from `System.Object`

## Summary

Provides methods for constructing [FunctionType](https://docs.yarnspinner.dev/api/csharp/yarn/yarn.functiontype) objects.

```csharp
public class FunctionTypeBuilder
```

## Remarks

To use this class, create an instance of it, and call the `With` -prefixed methods to set properties. When you're done, access the [FunctionType](https://docs.yarnspinner.dev/api/csharp/yarn.compiler/yarn.compiler.functiontypebuilder/yarn.compiler.functiontypebuilder.functiontype) property to get the final, constructed [FunctionType](https://docs.yarnspinner.dev/api/csharp/yarn/yarn.functiontype) .

## Methods

| Name                                                                                                                                                                                     | Description                                                                                                                                                                                                                                                                                              |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [FromFunctionType(System.Type)](https://docs.yarnspinner.dev/api/csharp/yarn.compiler/yarn.compiler.functiontypebuilder/yarn.compiler.functiontypebuilder.fromfunctiontype)              | Creates a new [FunctionTypeBuilder](https://docs.yarnspinner.dev/api/csharp/yarn.compiler/yarn.compiler.functiontypebuilder) based on a delegate type.                                                                                                                                                   |
| [WithParameter(IType)](https://docs.yarnspinner.dev/api/csharp/yarn.compiler/yarn.compiler.functiontypebuilder/yarn.compiler.functiontypebuilder.withparameter)                          | Adds a new parameter of type `parameterType` to the [FunctionType](https://docs.yarnspinner.dev/api/csharp/yarn.compiler/yarn.compiler.functiontypebuilder/yarn.compiler.functiontypebuilder.functiontype) .                                                                                             |
| [WithReturnType(IType)](https://docs.yarnspinner.dev/api/csharp/yarn.compiler/yarn.compiler.functiontypebuilder/yarn.compiler.functiontypebuilder.withreturntype)                        | Sets the [ReturnType](https://docs.yarnspinner.dev/api/csharp/yarn/yarn.functiontype/yarn.functiontype.returntype) of the [FunctionType](https://docs.yarnspinner.dev/api/csharp/yarn.compiler/yarn.compiler.functiontypebuilder/yarn.compiler.functiontypebuilder.functiontype) .                       |
| [WithVariadicParameterType(IType?)](https://docs.yarnspinner.dev/api/csharp/yarn.compiler/yarn.compiler.functiontypebuilder/yarn.compiler.functiontypebuilder.withvariadicparametertype) | Sets the [VariadicParameterType](https://docs.yarnspinner.dev/api/csharp/yarn/yarn.functiontype/yarn.functiontype.variadicparametertype) of the [FunctionType](https://docs.yarnspinner.dev/api/csharp/yarn.compiler/yarn.compiler.functiontypebuilder/yarn.compiler.functiontypebuilder.functiontype) . |

## Properties

| Name                                                                                                                                                   | Description                                                                                                                                                                                                                                                                                                   |
| ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [FunctionType](https://docs.yarnspinner.dev/api/csharp/yarn.compiler/yarn.compiler.functiontypebuilder/yarn.compiler.functiontypebuilder.functiontype) | Gets the [FunctionType](https://docs.yarnspinner.dev/api/csharp/yarn.compiler/yarn.compiler.functiontypebuilder/yarn.compiler.functiontypebuilder.functiontype) instance constructed by this [FunctionTypeBuilder](https://docs.yarnspinner.dev/api/csharp/yarn.compiler/yarn.compiler.functiontypebuilder) . |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yarnspinner.dev/api/csharp/yarn.compiler/yarn.compiler.functiontypebuilder.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
