# GeneratedContextImportAttribute&lt;TContext&gt;

Package: [Microsoft.Orleans.Serialization.Abstractions](/orleans/docs/api/csharp/microsoft.orleans.serialization.abstractions/) 10.0.0

[NuGet package](https://www.nuget.org/packages/Microsoft.Orleans.Serialization.Abstractions) | [Source](https://github.com/dotnet/orleans/blob/997f2589e814db85c6a451b59c081c88e50b8944/src/Orleans.Serialization.Abstractions/GeneratedContextImportAttribute.cs#L21)

```csharp
public sealed class GeneratedContextImportAttribute<TContext> : Attribute
```

Imports the closed type graph provided by another generated context.

## Remarks

Apply this attribute to a partial class derived from `Orleans.Serialization.GeneratedContext`. The included context requires accessible parameterless construction and declares its roots using `Orleans.GeneratedContextTypeAttribute-1` or links using this attribute. Generation treats those roots as provided endpoints and traverses the remaining local graph. The included context supplies its own factories and dependency metadata, so consumers can use reference assemblies. Includes form an acyclic graph, ensuring each root has an owning context. Shared links are configured once per type-manifest provider key. Register the resulting context using `AddGeneratedContext`. Generic attributes require C# 11 or later.

## Type parameters

- `TContext`: The concrete generated context to include.

## Constructors

- [GeneratedContextImportAttribute&lt;TContext&gt;](/orleans/docs/api/csharp/microsoft.orleans.serialization.abstractions/orleans.generatedcontextimportattribute-1/constructors/constructor-de3cbf4a/)
