# InternalServiceCollectionExtensions Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.utilities.internal.internalservicecollectionextensions/)

## AddFromExisting(IServiceCollection, Type, Type) {#addfromexisting-this-microsoft-extensions-dependencyinjection-iservicecollection-487163ce}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.utilities.internal.internalservicecollectionextensions/methods/addfromexisting-this-microsoft-extensions-dependencyinjection-iservicecollection-487163ce/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Utilities/ServiceCollectionExtensions.cs#L31-L51)

```csharp
public static void AddFromExisting(this IServiceCollection services, Type service, Type implementation)
```

Registers an existing registration of `implementation` as a provider of service type `service`.

### Parameters

- `services` (`IServiceCollection`): The service collection.
- `service` (`Type`): The service type being provided.
- `implementation` (`Type`): The implementation of `service`.

## AddFromExisting(IServiceCollection) {#addfromexisting-2-this-microsoft-extensions-dependencyinjection-iservicecollecti-3206cf38}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.utilities.internal.internalservicecollectionextensions/methods/addfromexisting-2-this-microsoft-extensions-dependencyinjection-iservicecollecti-3206cf38/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Utilities/ServiceCollectionExtensions.cs#L20-L21)

```csharp
public static void AddFromExisting<TService, TImplementation>(this IServiceCollection services)
```

Registers an existing registration of `TImplementation` as a provider of service type `TService`.

### Parameters

- `services` (`IServiceCollection`): The service collection.
