C
C#13mo ago
CrosRoad95

❔ Service provider, IDisposable

if i do:
Services.AddScoped/Transient<MyDisposableClass>();
class MyDisposableClass : IDisposable { ... }
Services.AddScoped/Transient<MyDisposableClass>();
class MyDisposableClass : IDisposable { ... }
will dispose method called when service goes out of scope?
14 Replies
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
CrosRoad95
CrosRoad95OP13mo ago
1. no, 2. no 😄
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
CrosRoad95
CrosRoad95OP13mo ago
let's say my scope it http request http request end, do all scoped services dispose method will be called
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
CrosRoad95
CrosRoad95OP13mo ago
i can say yes
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
CrosRoad95
CrosRoad95OP13mo ago
are scopes expansive?
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
CrosRoad95
CrosRoad95OP13mo ago
expensive*
MODiX
MODiX13mo ago
TeBeCo
aspnetcore explicitly create a Scope on DI for each request
Quoted by
React with ❌ to remove this embed.
CrosRoad95
CrosRoad95OP13mo ago
english is not my native language 😄
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Accord
Accord13mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server