0
jack created
At what point is called the AbpDbContext.Initialize() method?
public virtual void Initialize()
{
Database.Initialize(false);
this.SetFilterScopedParameterValue(AbpDataFilters.MustHaveTenant, AbpDataFilters.Parameters.TenantId, AbpSession.TenantId ?? 0);
this.SetFilterScopedParameterValue(AbpDataFilters.MayHaveTenant, AbpDataFilters.Parameters.TenantId, AbpSession.TenantId);
}
and why do you use Singleton rather than dependency injection? protected AbpDbContext() { Logger = NullLogger.Instance; AbpSession = NullAbpSession.Instance; EntityChangeEventHelper = NullEntityChangeEventHelper.Instance; }
why not protected AbpDbContext(ILogger,IAbpSession) ?
3 Answer(s)
-
0
Hi,
This is not sigleton. I use dependency injection. I'm using property-injection pattern (see document: <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Dependency-Injection#DocPropertyInjection">http://www.aspnetboilerplate.com/Pages/ ... yInjection</a>)
-
0
Thanks
But when the "Initialize" method in ApbDbContext is started?
-
0
Just after it's created but before properties injected.