# PersistentStateAttributeMapper Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.runtime/orleans.persistentstateattributemapper/)

## GetFactory(ParameterInfo, PersistentStateAttribute) {#getfactory-system-reflection-parameterinfo-orleans-runtime-persistentstateattrib-e59f2108}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.runtime/orleans.persistentstateattributemapper/methods/getfactory-system-reflection-parameterinfo-orleans-runtime-persistentstateattrib-e59f2108/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Runtime/Facet/Persistent/PersistentStateAttributeMapper.cs#L19-L36)

```csharp
public Factory<IGrainContext, object> GetFactory(ParameterInfo parameter, PersistentStateAttribute attribute)
```

Responsible for mapping a facet metadata to a cachable factory from the parameter and facet metadata.

### Parameters

- `parameter` (`ParameterInfo`): The parameter info.
- `attribute` (`PersistentStateAttribute`): The metadata.

### Returns

The factory used to create facet instances for a grain.
