Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 535 Bytes

File metadata and controls

16 lines (11 loc) · 535 Bytes

DotPython per-session DI sample

This sample demonstrates stateful Python code registered as a normal scoped C# service:

  • SessionCounter.dpyproj declares PerSession state.
  • repeated resolutions and calls in one DI scope share Python module globals;
  • another DI scope receives independent module globals;
  • the scopes are logical state boundaries, not security boundaries.

Run it from the repository root:

dotnet run --project samples/DotPython.PerSession/Consumer/Consumer.csproj

The expected output is 1,2,1.