private void EnsureObjectIsActive(IActivationContext context) { if (!context.Depth().Mode().IsActivate()) { return; } if (Handlers4.IsValueType(GetHandler())) { return; } ObjectContainerBase container = context.Container(); ClassMetadata classMetadata = container.ClassMetadataForObject(context.TargetObject ()); if (classMetadata == null || !classMetadata.HasIdentity()) { return; } if (container.IsActive(context.TargetObject())) { return; } container.StillToActivate(context.Descend()); }