# Sandbox.Internal.TypeLibrary.GetType

## Overload 1

```csharp
TypeDescription GetType(System.Type type)
```

Get the description for a specific type. This will return null if you don't have whitelist access to the type.
For constructed generic types, this will give you the description of the generic type definition.

### Parameters

- `type` (`System.Type`)

### Returns

`TypeDescription`

## Overload 2

```csharp
TypeDescription GetType(string name)
```

Find a TypeDescription that derives from `T`, by name

### Parameters

- `name` (`string`)

### Returns

`TypeDescription`

## Overload 3

```csharp
TypeDescription GetType(string name, bool preferAddonAssembly)
```

Find a TypeDescription that derives from T by name, which can be an Alias etc.
If preferAddonAssembly is true, then if there are conflicts we'll prefer types that are 
in addon code.

### Parameters

- `name` (`string`)
- `preferAddonAssembly` (`bool`)

### Returns

`TypeDescription`

## Overload 4

```csharp
TypeDescription GetType(string name, bool preferAddonAssembly, bool exactFullName)
```

Find a TypeDescription that derives from T by name, which can be an Alias etc.
If preferAddonAssembly is true, then if there are conflicts we'll prefer types that are 
in addon code.
If exactFullName is true, the name must match the FullName of the type.

### Parameters

- `name` (`string`)
- `preferAddonAssembly` (`bool`)
- `exactFullName` (`bool`)

### Returns

`TypeDescription`

## Overload 5

```csharp
TypeDescription GetType(System.Type type, string name, bool preferAddonAssembly = False, bool exactFullName = False)
```

Find a TypeDescription that derives from T by name, which can be an Alias etc.
If preferAddonAssembly is true, then if there are conflicts we'll prefer types that are 
in addon code.

### Parameters

- `type` (`System.Type`): The base type to search for, or null to search all types
- `name` (`string`): The name to search for, which can be an alias or the full name depending on the value of `exactFullName`
- `preferAddonAssembly` (`bool`), default `False`: If true, then if there are conflicts we'll prefer types that are in addon code.
- `exactFullName` (`bool`), default `False`: If true, the name must match the FullName (or alias) of the type

### Returns

`TypeDescription`

## Overload 6

```csharp
TypeDescription GetType()
```

Find the description for templated type

### Returns

`TypeDescription`

## Overload 7

```csharp
TypeDescription GetType(string name, bool exactFullName = False)
```

Find a TypeDescription by name

### Parameters

- `name` (`string`)
- `exactFullName` (`bool`), default `False`

### Returns

`TypeDescription`

## Overload 8

```csharp
TypeDescription GetType(string name, System.Type baseType)
```

> **Obsolete.** Use GetType with the arguments the other way around

Find a TypeDescription that derives from `baseType`, by name

### Parameters

- `name` (`string`)
- `baseType` (`System.Type`)

### Returns

`TypeDescription`

Declared in [Sandbox.Internal.TypeLibrary](/api/Sandbox.Internal.TypeLibrary).
Assembly: `Sandbox.Reflection`.
