You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand the need of EF factory, but is it really neccessary in Core version?
Isn’t simpler to use built in scope factory and default EF core scope lifetime.
So every time the shorter than request (or longer) is required use:
using(var scope = scopeFactory.CreateScope())
{
var context = scope.ServiceProvider.GetRequiredService<DbContext>();
}
This should result with exactly the same purpose, but will allow greater flexibility with sharing context between different repositories for transactions.
I understand the need of EF factory, but is it really neccessary in Core version?
Isn’t simpler to use built in scope factory and default EF core scope lifetime.
So every time the shorter than request (or longer) is required use:
This should result with exactly the same purpose, but will allow greater flexibility with sharing context between different repositories for transactions.
Another thing is related about finalizer inside subscription code. You should never use it unless there are unmanaged resources. Here is great article about this:
https://ericlippert.com/2015/05/18/when-everything-you-know-is-wrong-part-one/
Third one: why scoped
IHubContext
. Why scoped. As far as I know it is by default singleton. So why to change it?The text was updated successfully, but these errors were encountered: