void DisposeScope(IJob job, ILifetimeScope lifetimeScope) { if (_logger.IsDebugEnabled) { _logger.Info($"Disposing Scope 0x{ lifetimeScope?.GetHashCode() ?? 0:x} for Job 0x{job?.GetHashCode() ?? 0:x}"); } lifetimeScope?.Dispose(); }
static void DisposeScope(IJob job, ILifetimeScope lifetimeScope) { if (s_log.IsTraceEnabled) { s_log.TraceFormat("Disposing Scope 0x{0:x} for Job 0x{1:x}", lifetimeScope?.GetHashCode() ?? 0, job?.GetHashCode() ?? 0); } lifetimeScope?.Dispose(); }
void DisposeScope(IJob job, ILifetimeScope lifetimeScope) { _logDebug(job, string.Format("Disposing Scope 0x{0:x} for Job 0x{1:x}", lifetimeScope != null ? lifetimeScope.GetHashCode() : 0, job != null ? job.GetHashCode() : 0)); if (lifetimeScope != null) { lifetimeScope.Dispose(); } }
public AutofacAdapter(ILifetimeScope container) { if (container == null) { LifetimeScope = new ContainerBuilder().Build(); } else { LifetimeScope = container; Logger.Debug("Starting new lifetime scope {0}", LifetimeScope.GetHashCode()); } }
private static void DisposeScope(IJob job, ILifetimeScope lifetimeScope) { if (s_log.IsDebugEnabled) { s_log.DebugFormat("Disposing Scope 0x{0:x} for Job 0x{1:x}", lifetimeScope != null ? lifetimeScope.GetHashCode() : 0, job != null ? job.GetHashCode() : 0); } if (lifetimeScope != null) { lifetimeScope.Dispose(); } }
static void DisposeScope(IJob job, ILifetimeScope lifetimeScope) { if (SLog.IsTraceEnabled) { SLog.TraceFormat("Disposing Scope 0x{0:x} for Job 0x{1:x}", lifetimeScope == null ? 0 : lifetimeScope.GetHashCode(), job == null ? 0 : job.GetHashCode()); } if (lifetimeScope != null) { lifetimeScope.Dispose(); } }
private static void Method08() { string tag = "test"; ContainerBuilder builder = new ContainerBuilder(); builder.RegisterType <Program>().AsSelf().InstancePerLifetimeScope();//.InstancePerMatchingLifetimeScope(tag); IContainer container = builder.Build(); ILifetimeScope scope1 = container.BeginLifetimeScope(tag); Console.WriteLine(scope1.GetHashCode()); Program p1 = scope1.Resolve <Program>(); Console.WriteLine(p1.GetHashCode()); p1 = scope1.Resolve <Program>(); Console.WriteLine(p1.GetHashCode()); ILifetimeScope scope2 = container.BeginLifetimeScope(tag); Console.WriteLine(scope2.GetHashCode()); Program p2 = scope2.Resolve <Program>(); Console.WriteLine(p2.GetHashCode()); p2 = scope2.Resolve <Program>(); Console.WriteLine(p2.GetHashCode()); }
void DisposeScope(IJob job, ILifetimeScope lifetimeScope) { _logDebug(job, string.Format("Disposing Scope 0x{0:x} for Job 0x{1:x}", lifetimeScope != null ? lifetimeScope.GetHashCode() : 0, job != null ? job.GetHashCode() : 0)); if (lifetimeScope != null) lifetimeScope.Dispose(); }
private static void DisposeScope(IJob job, ILifetimeScope lifetimeScope) { if (s_log.IsDebugEnabled) { s_log.DebugFormat("Disposing Scope 0x{0:x} for Job 0x{1:x}", lifetimeScope != null ? lifetimeScope.GetHashCode() : 0, job != null ? job.GetHashCode() : 0); } if (lifetimeScope != null) lifetimeScope.Dispose(); }
public override int GetHashCode() { return(LifetimeScope.GetHashCode()); }