public object GetInstance(InstanceContext instanceContext, Message message)
        {
            OrchardInstanceContext item = new OrchardInstanceContext(_workContextAccessor);

            instanceContext.Extensions.Add(item);
            return(item.Resolve(_componentRegistration));
        }
        public void ReleaseInstance(InstanceContext instanceContext, object instance)
        {
            OrchardInstanceContext context = instanceContext.Extensions.Find <OrchardInstanceContext>();

            if (context != null)
            {
                context.Dispose();
            }
        }