# IGrainContext

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

[NuGet package](https://www.nuget.org/packages/Microsoft.Orleans.Core.Abstractions) | [Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/Core/IGrainContext.cs#L12)

```csharp
public interface IGrainContext : ITargetHolder, IEquatable<IGrainContext>
```

Represents a grain from the perspective of the runtime.

## Properties

- [ActivationId](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igraincontext/properties/activationid-fce9bc3d/)
- [ActivationServices](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igraincontext/properties/activationservices-45393be2/)
- [Address](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igraincontext/properties/address-e9b8a094/)
- [Deactivated](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igraincontext/properties/deactivated-fbaa5aa6/)
- [GrainId](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igraincontext/properties/grainid-2160b6c5/)
- [GrainInstance](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igraincontext/properties/graininstance-8dbb1c85/)
- [GrainReference](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igraincontext/properties/grainreference-fdbd317f/)
- [ObservableLifecycle](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igraincontext/properties/observablelifecycle-a4d26d54/)
- [Scheduler](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igraincontext/properties/scheduler-c9fd8f0e/)

## Methods

- [Activate(Dictionary&lt;string, object&gt;, CancellationToken)](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igraincontext/methods/activate-system-collections-generic-dictionary-string-object-nullable-system-thr-e7173ae1/)
- [Deactivate(DeactivationReason, CancellationToken)](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igraincontext/methods/deactivate-orleans-deactivationreason-system-threading-cancellationtoken-65f3d00f/)
- [Migrate(Dictionary&lt;string, object&gt;, CancellationToken)](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igraincontext/methods/migrate-system-collections-generic-dictionary-string-object-nullable-system-thre-3cae54ff/)
- [ReceiveMessage(object)](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igraincontext/methods/receivemessage-object-66048c92/)
- [Rehydrate(IRehydrationContext)](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igraincontext/methods/rehydrate-orleans-runtime-irehydrationcontext-e7a43f12/)
- [SetComponent(TComponent?)](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igraincontext/methods/setcomponent-1-tcomponent-nullable-e51f7c17/)
