> For the complete documentation index, see [llms.txt](https://docs.yarnspinner.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yarnspinner.dev/3.1/api/csharp/yarn.compiler/yarn.compiler.functiontypebuilder.md).

# FunctionTypeBuilder

Class in [Yarn.Compiler](/3.1/api/csharp/yarn.compiler.md)

Inherits from `System.Object`

## Summary

Provides methods for constructing [FunctionType](/3.1/api/csharp/yarn/yarn.functiontype.md) 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](/3.1/api/csharp/yarn.compiler/yarn.compiler.functiontypebuilder/yarn.compiler.functiontypebuilder.functiontype.md) property to get the final, constructed [FunctionType](/3.1/api/csharp/yarn/yarn.functiontype.md) .

## Methods

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

## Properties

| Name                                                                                                                              | Description                                                                                                                                                                                                                                                         |
| --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [FunctionType](/3.1/api/csharp/yarn.compiler/yarn.compiler.functiontypebuilder/yarn.compiler.functiontypebuilder.functiontype.md) | Gets the [FunctionType](/3.1/api/csharp/yarn.compiler/yarn.compiler.functiontypebuilder/yarn.compiler.functiontypebuilder.functiontype.md) instance constructed by this [FunctionTypeBuilder](/3.1/api/csharp/yarn.compiler/yarn.compiler.functiontypebuilder.md) . |
