#### [Abblix\.DependencyInjection](https://www.abblix.com/en/docs/api/abblix-dependencyinjection 'index')
### [Abblix\.DependencyInjection](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection 'Abblix\.DependencyInjection')

## IComposition\<TInterface\> Interface

A live editing cursor over a family's members\.
Returned by [Decompose&lt;TInterface&gt;\(this IServiceCollection\)](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.ServiceCollectionExtensions#Abblix.DependencyInjection.ServiceCollectionExtensions.Decompose_TInterface_(thisMicrosoft.Extensions.DependencyInjection.IServiceCollection) 'Abblix\.DependencyInjection\.ServiceCollectionExtensions\.Decompose\<TInterface\>\(this Microsoft\.Extensions\.DependencyInjection\.IServiceCollection\)'),
it is an [System\.Collections\.Generic\.IList&lt;&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ilist-1 'System\.Collections\.Generic\.IList\`1') of the member descriptors backed directly by the service collection:
inserting, removing or reordering through it mutates the family's registrations in place\.
A composed family's composite reads its members via `GetKeyedServices` at resolve time,
so edits made through the cursor take effect with no separate recompose step \-
the members simply differ when the composite is finally resolved\.

```csharp
public interface IComposition<in TInterface> : System.Collections.Generic.IList<Microsoft.Extensions.DependencyInjection.ServiceDescriptor>, System.Collections.Generic.ICollection<Microsoft.Extensions.DependencyInjection.ServiceDescriptor>, System.Collections.Generic.IEnumerable<Microsoft.Extensions.DependencyInjection.ServiceDescriptor>, System.Collections.IEnumerable
    where TInterface : class
```
#### Type parameters

###### `TInterface` {#Abblix.DependencyInjection.IComposition_TInterface_.TInterface}

The composed interface type\.

Implements [System\.Collections\.Generic\.IList&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ilist-1 'System\.Collections\.Generic\.IList\`1')[Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.servicedescriptor 'Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ilist-1 'System\.Collections\.Generic\.IList\`1'), [System\.Collections\.Generic\.ICollection&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.icollection-1 'System\.Collections\.Generic\.ICollection\`1')[Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.servicedescriptor 'Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.icollection-1 'System\.Collections\.Generic\.ICollection\`1'), [System\.Collections\.Generic\.IEnumerable&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 'System\.Collections\.Generic\.IEnumerable\`1')[Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.servicedescriptor 'Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 'System\.Collections\.Generic\.IEnumerable\`1'), [System\.Collections\.IEnumerable](https://learn.microsoft.com/en-us/dotnet/api/system.collections.ienumerable 'System\.Collections\.IEnumerable')

### Remarks
The position\-aware editing methods live here rather than as extension methods so that
[TInterface](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_#Abblix.DependencyInjection.IComposition_TInterface_.TInterface 'Abblix\.DependencyInjection\.IComposition\<TInterface\>\.TInterface') is bound by the cursor and never repeated at the call site \-
only the anchor type is named \(`composition.AddAfter<ScopeValidator>(step)`\)\.
Each returns the cursor, so edits chain, and each anchor is matched by implementation type,
throwing when the anchor is not a member\.
### Methods

## IComposition\<TInterface\>\.AddAfter\<TExisting\>\(ServiceDescriptor\) Method {#Abblix.DependencyInjection.IComposition_TInterface_.AddAfter_TExisting_(Microsoft.Extensions.DependencyInjection.ServiceDescriptor)}

Inserts [member](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_#Abblix.DependencyInjection.IComposition_TInterface_.AddAfter_TExisting_(Microsoft.Extensions.DependencyInjection.ServiceDescriptor).member 'Abblix\.DependencyInjection\.IComposition\<TInterface\>\.AddAfter\<TExisting\>\(Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor\)\.member') immediately after the existing [TExisting](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_#Abblix.DependencyInjection.IComposition_TInterface_.AddAfter_TExisting_(Microsoft.Extensions.DependencyInjection.ServiceDescriptor).TExisting 'Abblix\.DependencyInjection\.IComposition\<TInterface\>\.AddAfter\<TExisting\>\(Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor\)\.TExisting') step\.

```csharp
Abblix.DependencyInjection.IComposition<TInterface> AddAfter<TExisting>(Microsoft.Extensions.DependencyInjection.ServiceDescriptor member)
    where TExisting : TInterface;
```
#### Type parameters

###### `TExisting` {#Abblix.DependencyInjection.IComposition_TInterface_.AddAfter_TExisting_(Microsoft.Extensions.DependencyInjection.ServiceDescriptor).TExisting}
#### Parameters

###### `member` [Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.servicedescriptor 'Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor') {#Abblix.DependencyInjection.IComposition_TInterface_.AddAfter_TExisting_(Microsoft.Extensions.DependencyInjection.ServiceDescriptor).member}

#### Returns
[Abblix\.DependencyInjection\.IComposition&lt;](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_ 'Abblix\.DependencyInjection\.IComposition\<TInterface\>')[TInterface](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_#Abblix.DependencyInjection.IComposition_TInterface_.TInterface 'Abblix\.DependencyInjection\.IComposition\<TInterface\>\.TInterface')[&gt;](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_ 'Abblix\.DependencyInjection\.IComposition\<TInterface\>')

## IComposition\<TInterface\>\.AddBefore\<TExisting\>\(ServiceDescriptor\) Method {#Abblix.DependencyInjection.IComposition_TInterface_.AddBefore_TExisting_(Microsoft.Extensions.DependencyInjection.ServiceDescriptor)}

Inserts [member](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_#Abblix.DependencyInjection.IComposition_TInterface_.AddBefore_TExisting_(Microsoft.Extensions.DependencyInjection.ServiceDescriptor).member 'Abblix\.DependencyInjection\.IComposition\<TInterface\>\.AddBefore\<TExisting\>\(Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor\)\.member') immediately before the existing [TExisting](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_#Abblix.DependencyInjection.IComposition_TInterface_.AddBefore_TExisting_(Microsoft.Extensions.DependencyInjection.ServiceDescriptor).TExisting 'Abblix\.DependencyInjection\.IComposition\<TInterface\>\.AddBefore\<TExisting\>\(Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor\)\.TExisting') step\.

```csharp
Abblix.DependencyInjection.IComposition<TInterface> AddBefore<TExisting>(Microsoft.Extensions.DependencyInjection.ServiceDescriptor member)
    where TExisting : TInterface;
```
#### Type parameters

###### `TExisting` {#Abblix.DependencyInjection.IComposition_TInterface_.AddBefore_TExisting_(Microsoft.Extensions.DependencyInjection.ServiceDescriptor).TExisting}
#### Parameters

###### `member` [Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.servicedescriptor 'Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor') {#Abblix.DependencyInjection.IComposition_TInterface_.AddBefore_TExisting_(Microsoft.Extensions.DependencyInjection.ServiceDescriptor).member}

#### Returns
[Abblix\.DependencyInjection\.IComposition&lt;](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_ 'Abblix\.DependencyInjection\.IComposition\<TInterface\>')[TInterface](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_#Abblix.DependencyInjection.IComposition_TInterface_.TInterface 'Abblix\.DependencyInjection\.IComposition\<TInterface\>\.TInterface')[&gt;](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_ 'Abblix\.DependencyInjection\.IComposition\<TInterface\>')

## IComposition\<TInterface\>\.AddFirst\(ServiceDescriptor\) Method {#Abblix.DependencyInjection.IComposition_TInterface_.AddFirst(Microsoft.Extensions.DependencyInjection.ServiceDescriptor)}

Inserts [member](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_#Abblix.DependencyInjection.IComposition_TInterface_.AddFirst(Microsoft.Extensions.DependencyInjection.ServiceDescriptor).member 'Abblix\.DependencyInjection\.IComposition\<TInterface\>\.AddFirst\(Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor\)\.member') as the first step of the family\.

```csharp
Abblix.DependencyInjection.IComposition<TInterface> AddFirst(Microsoft.Extensions.DependencyInjection.ServiceDescriptor member);
```
#### Parameters

###### `member` [Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.servicedescriptor 'Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor') {#Abblix.DependencyInjection.IComposition_TInterface_.AddFirst(Microsoft.Extensions.DependencyInjection.ServiceDescriptor).member}

#### Returns
[Abblix\.DependencyInjection\.IComposition&lt;](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_ 'Abblix\.DependencyInjection\.IComposition\<TInterface\>')[TInterface](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_#Abblix.DependencyInjection.IComposition_TInterface_.TInterface 'Abblix\.DependencyInjection\.IComposition\<TInterface\>\.TInterface')[&gt;](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_ 'Abblix\.DependencyInjection\.IComposition\<TInterface\>')

## IComposition\<TInterface\>\.AddLast\(ServiceDescriptor\) Method {#Abblix.DependencyInjection.IComposition_TInterface_.AddLast(Microsoft.Extensions.DependencyInjection.ServiceDescriptor)}

Ensures [member](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_#Abblix.DependencyInjection.IComposition_TInterface_.AddLast(Microsoft.Extensions.DependencyInjection.ServiceDescriptor).member 'Abblix\.DependencyInjection\.IComposition\<TInterface\>\.AddLast\(Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor\)\.member') is in the family, appending it as the last step when it is not\.
A member already there stays where it is: a family holds one member per implementation type, so there
is nothing to add and no second copy to place\.

```csharp
Abblix.DependencyInjection.IComposition<TInterface> AddLast(Microsoft.Extensions.DependencyInjection.ServiceDescriptor member);
```
#### Parameters

###### `member` [Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.servicedescriptor 'Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor') {#Abblix.DependencyInjection.IComposition_TInterface_.AddLast(Microsoft.Extensions.DependencyInjection.ServiceDescriptor).member}

#### Returns
[Abblix\.DependencyInjection\.IComposition&lt;](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_ 'Abblix\.DependencyInjection\.IComposition\<TInterface\>')[TInterface](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_#Abblix.DependencyInjection.IComposition_TInterface_.TInterface 'Abblix\.DependencyInjection\.IComposition\<TInterface\>\.TInterface')[&gt;](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_ 'Abblix\.DependencyInjection\.IComposition\<TInterface\>')

## IComposition\<TInterface\>\.Remove\<TExisting\>\(\) Method {#Abblix.DependencyInjection.IComposition_TInterface_.Remove_TExisting_()}

Removes the existing [TExisting](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_#Abblix.DependencyInjection.IComposition_TInterface_.Remove_TExisting_().TExisting 'Abblix\.DependencyInjection\.IComposition\<TInterface\>\.Remove\<TExisting\>\(\)\.TExisting') step from the family\.

```csharp
Abblix.DependencyInjection.IComposition<TInterface> Remove<TExisting>()
    where TExisting : TInterface;
```
#### Type parameters

###### `TExisting` {#Abblix.DependencyInjection.IComposition_TInterface_.Remove_TExisting_().TExisting}

#### Returns
[Abblix\.DependencyInjection\.IComposition&lt;](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_ 'Abblix\.DependencyInjection\.IComposition\<TInterface\>')[TInterface](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_#Abblix.DependencyInjection.IComposition_TInterface_.TInterface 'Abblix\.DependencyInjection\.IComposition\<TInterface\>\.TInterface')[&gt;](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_ 'Abblix\.DependencyInjection\.IComposition\<TInterface\>')

## IComposition\<TInterface\>\.Replace\<TExisting\>\(ServiceDescriptor\) Method {#Abblix.DependencyInjection.IComposition_TInterface_.Replace_TExisting_(Microsoft.Extensions.DependencyInjection.ServiceDescriptor)}

Replaces the existing [TExisting](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_#Abblix.DependencyInjection.IComposition_TInterface_.Replace_TExisting_(Microsoft.Extensions.DependencyInjection.ServiceDescriptor).TExisting 'Abblix\.DependencyInjection\.IComposition\<TInterface\>\.Replace\<TExisting\>\(Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor\)\.TExisting') step with [member](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_#Abblix.DependencyInjection.IComposition_TInterface_.Replace_TExisting_(Microsoft.Extensions.DependencyInjection.ServiceDescriptor).member 'Abblix\.DependencyInjection\.IComposition\<TInterface\>\.Replace\<TExisting\>\(Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor\)\.member'), keeping its position\.

```csharp
Abblix.DependencyInjection.IComposition<TInterface> Replace<TExisting>(Microsoft.Extensions.DependencyInjection.ServiceDescriptor member)
    where TExisting : TInterface;
```
#### Type parameters

###### `TExisting` {#Abblix.DependencyInjection.IComposition_TInterface_.Replace_TExisting_(Microsoft.Extensions.DependencyInjection.ServiceDescriptor).TExisting}
#### Parameters

###### `member` [Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.servicedescriptor 'Microsoft\.Extensions\.DependencyInjection\.ServiceDescriptor') {#Abblix.DependencyInjection.IComposition_TInterface_.Replace_TExisting_(Microsoft.Extensions.DependencyInjection.ServiceDescriptor).member}

#### Returns
[Abblix\.DependencyInjection\.IComposition&lt;](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_ 'Abblix\.DependencyInjection\.IComposition\<TInterface\>')[TInterface](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_#Abblix.DependencyInjection.IComposition_TInterface_.TInterface 'Abblix\.DependencyInjection\.IComposition\<TInterface\>\.TInterface')[&gt;](https://www.abblix.com/en/docs/api/abblix-dependencyinjection/Abblix.DependencyInjection.IComposition_TInterface_ 'Abblix\.DependencyInjection\.IComposition\<TInterface\>')
