# InMemoryLogger.BeginScope(TState)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.logging.inmemorylogger/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.logging.inmemorylogger/methods/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.TestingHost/Logging/InMemoryLoggerProvider.cs#L298)

```csharp
public IDisposable? BeginScope<TState>(TState state)
```

Begins a logical operation scope.

### Parameters

- `state` (`TState`): The identifier for the scope.

### Returns

An `System.IDisposable` that ends the logical operation scope on dispose.
