# DefaultGrainActivator Constructors

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

## DefaultGrainActivator(IServiceProvider, Type) {#constructor-system-iserviceprovider-system-type-0f1e9347}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.runtime/orleans.runtime.defaultgrainactivator/constructors/constructor-system-iserviceprovider-system-type-0f1e9347/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Runtime/Activation/DefaultGrainActivator.cs#L21-L26)

```csharp
public DefaultGrainActivator(IServiceProvider serviceProvider, Type grainClass)
```

Initializes a new [DefaultGrainActivator](/orleans/docs/api/csharp/microsoft.orleans.runtime/orleans.runtime.defaultgrainactivator/) instance.

### Parameters

- `serviceProvider` (`IServiceProvider`): The service provider.
- `grainClass` (`Type`): The grain class.
